/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('eds-aic', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DataImageRegionDistributeMapValue = {
  distributeStatus?: string(name='DistributeStatus', description='The status of the image distribution task.

Valid values:

*   AVAILABLE: The task is ready.
*   DELETE: The task is deleted.
*   INIT: The task is being initialized.
*   CREATE_FAILED: The task failed to be created.
*   CREATING: The task is being created.', example='AVAILABLE'),
  progress?: string(name='Progress', description='The distribution progress of the image.', example='100%'),
}

model AttachKeyPairRequest {
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.'),
  keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.

This parameter is required.', example='kp-6v2q33ae4tw3a****'),
}

model AttachKeyPairResponseBody = {
  data?: {
    attachedInstanceIds?: [ string ](name='AttachedInstanceIds', description='The IDs of the cloud phone instances to which the ADB key pair is successfully attached.'),
    failCount?: int32(name='FailCount', description='The number of the cloud phone instances to which the ADB key pair failed to be attached.', example='0'),
    keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.', example='kp-6v2q33ae4tw3a****'),
    totalCount?: int32(name='TotalCount', description='The total number of the cloud phone instances.', example='100'),
  }(name='Data', description='The object that is returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model AttachKeyPairResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachKeyPairResponseBody(name='body'),
}

/**
 * @summary Attaches an Android Debug Bridge (ADB) key pair to one or more cloud phone instances.
 *
 * @description *   You can attach to an ADB key pair only to cloud phone instances in the Running state.
 * *   After you attach an ADB key pair, make sure the private key of the ADB key pair is copied to the ~/.android directory (macOS or Linux operating systems) or the C:\\Users\\Username.android directory (Windows operating systems). In addition, you must run the adb kill-server command to restart the ADB process to ensure correct ADB connection. Otherwise, ADB connection may fail due to authentication exceptions.
 *
 * @param request AttachKeyPairRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachKeyPairResponse
 */
async function attachKeyPairWithOptions(request: AttachKeyPairRequest, runtime: Util.RuntimeOptions): AttachKeyPairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachKeyPair',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Attaches an Android Debug Bridge (ADB) key pair to one or more cloud phone instances.
 *
 * @description *   You can attach to an ADB key pair only to cloud phone instances in the Running state.
 * *   After you attach an ADB key pair, make sure the private key of the ADB key pair is copied to the ~/.android directory (macOS or Linux operating systems) or the C:\\Users\\Username.android directory (Windows operating systems). In addition, you must run the adb kill-server command to restart the ADB process to ensure correct ADB connection. Otherwise, ADB connection may fail due to authentication exceptions.
 *
 * @param request AttachKeyPairRequest
 * @return AttachKeyPairResponse
 */
async function attachKeyPair(request: AttachKeyPairRequest): AttachKeyPairResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachKeyPairWithOptions(request, runtime);
}

model AuthorizeAndroidInstanceRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='List of instance IDs.'),
  authorizeUserId?: string(name='AuthorizeUserId', description='User ID to be assigned.', example='test'),
  unAuthorizeUserId?: string(name='UnAuthorizeUserId', description='User ID to be unassigned.', example='test'),
}

model AuthorizeAndroidInstanceResponseBody = {
  requestId?: string(name='RequestId', description='Request ID.', example='1A923337-44D9-5CAD-9A53-95084BD4****'),
}

model AuthorizeAndroidInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AuthorizeAndroidInstanceResponseBody(name='body'),
}

/**
 * @summary Authorize/unauthorize Android instances for users.
 *
 * @description Instance states that support user assignment: Available, Shutting Down, Stopped, Starting, Backing Up, Restoring, Backup Failed, Restore Failed.
 * Instance states that support unassignment: Available, Shutting Down, Stopped, Starting, Backing Up, Restoring, Backup Failed, Restore Failed, Expired, Overdue, Deleted.
 *
 * @param request AuthorizeAndroidInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AuthorizeAndroidInstanceResponse
 */
async function authorizeAndroidInstanceWithOptions(request: AuthorizeAndroidInstanceRequest, runtime: Util.RuntimeOptions): AuthorizeAndroidInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.authorizeUserId)) {
    query['AuthorizeUserId'] = request.authorizeUserId;
  }
  if (!Util.isUnset(request.unAuthorizeUserId)) {
    query['UnAuthorizeUserId'] = request.unAuthorizeUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthorizeAndroidInstance',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Authorize/unauthorize Android instances for users.
 *
 * @description Instance states that support user assignment: Available, Shutting Down, Stopped, Starting, Backing Up, Restoring, Backup Failed, Restore Failed.
 * Instance states that support unassignment: Available, Shutting Down, Stopped, Starting, Backing Up, Restoring, Backup Failed, Restore Failed, Expired, Overdue, Deleted.
 *
 * @param request AuthorizeAndroidInstanceRequest
 * @return AuthorizeAndroidInstanceResponse
 */
async function authorizeAndroidInstance(request: AuthorizeAndroidInstanceRequest): AuthorizeAndroidInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return authorizeAndroidInstanceWithOptions(request, runtime);
}

model BackupFileRequest {
  androidInstanceIdList?: [ string ](name='AndroidInstanceIdList', description='The IDs of the instances.

This parameter is required.'),
  backupAll?: boolean(name='BackupAll', description='Specifies whether to back up the whole instance.', example='true'),
  backupFileName?: string(name='BackupFileName', description='The name of the backup file.', example='defaultBackupFile'),
  backupFilePath?: string(name='BackupFilePath', description='The OSS path of the backup file.

>  To upload a backup file to an OSS bucket, you must obtain the name of the bucket. When calling the describeBuckets operation to retrieve a bucket name, you must also call the ossObjectList operation to obtain the object key. Combine these to form the full path: oss://${bucketName}/${key}.

This parameter is required.'),
  description?: string(name='Description', description='The description of the backup file.', example='This is a backup file description.'),
  sourceAppList?: [ string ](name='SourceAppList', description='The names of the application packages that you want to back up.'),
  sourceFilePathList?: [ string ](name='SourceFilePathList', description='The paths to the source files.'),
  uploadEndpoint?: string(name='UploadEndpoint', description='The endpoint of the OSS bucket to which you want to upload the backup file.

> : When calling the DescribeBuckets operation to query buckets, retrieve the IntranetEndpoint value if the cloud phone and the OSS bucket are in the same region. If they are in different regions, retrieve the ExtranetEndpoint value instead.', example='oss-cn-shanghai-internal.aliyuncs.com'),
  uploadType?: string(name='UploadType', description='The type of the backup.

Valid values:

*   OSS: uploads the backup file to an OSS bucket.', example='OSS'),
}

model BackupFileResponseBody = {
  count?: long(name='Count', description='The number of instances that are backed up.', example='100'),
  data?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the cloud phone instance.', example='acp-34pqe4r0kd9kn****'),
      backupFileId?: string(name='BackupFileId', description='The ID of the backup file.', example='bf-b0qbg3pbpjkn7****'),
      backupFileName?: string(name='BackupFileName', description='The name of the backup file.', example='a-58ftsoo90p0qa****.ab'),
      taskId?: string(name='TaskId', description='The task ID.', example='t-22ex666a5mco5****'),
    }
  ](name='Data', description='The object that is returned.', example='6C8439B9-7DBF-57F4-92AE-55A9B9D3****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6C8439B9-7DBF-57F4-92AE-55A9B9D3****'),
  taskId?: string(name='TaskId', description='The ID of the batch task.', example='t-22ex666a5mco5****'),
}

model BackupFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BackupFileResponseBody(name='body'),
}

/**
 * @summary Generates and uploads backup files.
 *
 * @description Currently, this operation allows you to upload only backup files generated by cloud phones to Object Storage Service (OSS) buckets.
 *
 * @param request BackupFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BackupFileResponse
 */
async function backupFileWithOptions(request: BackupFileRequest, runtime: Util.RuntimeOptions): BackupFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIdList)) {
    query['AndroidInstanceIdList'] = request.androidInstanceIdList;
  }
  if (!Util.isUnset(request.backupAll)) {
    query['BackupAll'] = request.backupAll;
  }
  if (!Util.isUnset(request.backupFileName)) {
    query['BackupFileName'] = request.backupFileName;
  }
  if (!Util.isUnset(request.backupFilePath)) {
    query['BackupFilePath'] = request.backupFilePath;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.sourceAppList)) {
    query['SourceAppList'] = request.sourceAppList;
  }
  if (!Util.isUnset(request.sourceFilePathList)) {
    query['SourceFilePathList'] = request.sourceFilePathList;
  }
  if (!Util.isUnset(request.uploadEndpoint)) {
    query['UploadEndpoint'] = request.uploadEndpoint;
  }
  if (!Util.isUnset(request.uploadType)) {
    query['UploadType'] = request.uploadType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BackupFile',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates and uploads backup files.
 *
 * @description Currently, this operation allows you to upload only backup files generated by cloud phones to Object Storage Service (OSS) buckets.
 *
 * @param request BackupFileRequest
 * @return BackupFileResponse
 */
async function backupFile(request: BackupFileRequest): BackupFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return backupFileWithOptions(request, runtime);
}

model BatchGetAcpConnectionTicketRequest {
  endUserId?: string(name='EndUserId', description='The ID of the user to whom the cloud phone instance is assigned.', example='user'),
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-25nt4kk9whjh****'),
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify 1 to 100 IDs of cloud phone instances.'),
  instanceTasks?: [ 
    {
      instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance.', example='acp-fkuit0cmyfvzz****'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='cn-hangzhou@c9f5c2e8-f5c4-4b01-8602-000cae94****'),
    }
  ](name='InstanceTasks', description='The instance connection tasks.'),
}

model BatchGetAcpConnectionTicketResponseBody = {
  instanceConnectionModels?: [ 
    {
      appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-1uzb6heg797z3****'),
      instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance.', example='acp-ajxvwo1u0hqvd****'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='cn-hangzhou@c9f5c2e8-f5c4-4b01-8602-000cae94****'),
      taskStatus?: string(name='TaskStatus', description='The state of the task.', example='FINISHED'),
      ticket?: string(name='Ticket', description='The ticket used to connect to the cloud phone instance.', example='piVE58_AdmVSVW7SEW3*AE5*p8mmO5gvItsNOmv4S_f_cNpoU_BOTwChTBoNM1ZJeedfK9zxYnbN5hossqIZCr6t7SGxRigm2Cb4fGaCdBZWIzmgdHq6sXXZQg4KFWufyvpeV*0*Cm58slMT1tJw3****'),
    }
  ](name='InstanceConnectionModels', description='The results of the instance connection tasks.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7B9EFA4F-4305-5968-BAEE-BD8B8DE5****'),
}

model BatchGetAcpConnectionTicketResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchGetAcpConnectionTicketResponseBody(name='body'),
}

/**
 * @summary Retrieves connection tickets in batch.
 *
 * @param request BatchGetAcpConnectionTicketRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchGetAcpConnectionTicketResponse
 */
async function batchGetAcpConnectionTicketWithOptions(request: BatchGetAcpConnectionTicketRequest, runtime: Util.RuntimeOptions): BatchGetAcpConnectionTicketResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endUserId)) {
    query['EndUserId'] = request.endUserId;
  }
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.instanceTasks)) {
    query['InstanceTasks'] = request.instanceTasks;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchGetAcpConnectionTicket',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Retrieves connection tickets in batch.
 *
 * @param request BatchGetAcpConnectionTicketRequest
 * @return BatchGetAcpConnectionTicketResponse
 */
async function batchGetAcpConnectionTicket(request: BatchGetAcpConnectionTicketRequest): BatchGetAcpConnectionTicketResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchGetAcpConnectionTicketWithOptions(request, runtime);
}

model ChangeCloudPhoneNodeRequest {
  instanceType?: string(name='InstanceType', example='ac.max'),
  nodeId?: string(name='NodeId', example='cpn-0ugbptfu473fy****'),
  phoneCount?: int32(name='PhoneCount', example='20'),
}

model ChangeCloudPhoneNodeResponseBody = {
  nodeInfos?: [ 
    {
      instanceInfos?: [ 
        {
          instanceId?: string(name='InstanceId', example='cpn-jewjt8xryuitu****'),
        }
      ](name='InstanceInfos'),
      nodeId?: string(name='NodeId', example='cpn-e5kxgjyt8s1mb****'),
    }
  ](name='NodeInfos'),
  requestId?: string(name='RequestId', example='4610632D-D661-5982-B3D7-5D3FD183F****'),
}

model ChangeCloudPhoneNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeCloudPhoneNodeResponseBody(name='body'),
}

/**
 * @summary 修改云手机矩阵的配置
 *
 * @param request ChangeCloudPhoneNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeCloudPhoneNodeResponse
 */
async function changeCloudPhoneNodeWithOptions(request: ChangeCloudPhoneNodeRequest, runtime: Util.RuntimeOptions): ChangeCloudPhoneNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.phoneCount)) {
    query['PhoneCount'] = request.phoneCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeCloudPhoneNode',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改云手机矩阵的配置
 *
 * @param request ChangeCloudPhoneNodeRequest
 * @return ChangeCloudPhoneNodeResponse
 */
async function changeCloudPhoneNode(request: ChangeCloudPhoneNodeRequest): ChangeCloudPhoneNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeCloudPhoneNodeWithOptions(request, runtime);
}

model CheckResourceStockRequest {
  acpSpecId?: string(name='AcpSpecId', description='Specification ID.', example='acp.basic.small'),
  amount?: int32(name='Amount'),
  bizRegionId?: string(name='BizRegionId', description='Region ID.

This parameter is required.', example='cn-hangzhou'),
  gpuAcceleration?: boolean(name='GpuAcceleration'),
  zoneId?: string(name='ZoneId', description='The availability zone of the resource.', example='cn-hangzhou-i'),
}

model CheckResourceStockResponseBody = {
  requestId?: string(name='RequestId', description='Request ID.', example='805D8FB6-512A-531C-9E4D-2A807D3C****'),
  resourceStockModels?: [ 
    {
      regionId?: string(name='RegionId', description='Region ID.', example='cn-shanghai'),
      stockStatus?: string(name='StockStatus', description='Inventory status of the instance group.', example='Available'),
      zoneId?: string(name='ZoneId', description='Zone ID.', example='cn-shanghai-b'),
    }
  ](name='ResourceStockModels', description='Details of resource inventory.'),
}

model CheckResourceStockResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckResourceStockResponseBody(name='body'),
}

/**
 * @summary Check the resource inventory.
 *
 * @param request CheckResourceStockRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckResourceStockResponse
 */
async function checkResourceStockWithOptions(request: CheckResourceStockRequest, runtime: Util.RuntimeOptions): CheckResourceStockResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acpSpecId)) {
    query['AcpSpecId'] = request.acpSpecId;
  }
  if (!Util.isUnset(request.amount)) {
    query['Amount'] = request.amount;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.gpuAcceleration)) {
    query['GpuAcceleration'] = request.gpuAcceleration;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckResourceStock',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Check the resource inventory.
 *
 * @param request CheckResourceStockRequest
 * @return CheckResourceStockResponse
 */
async function checkResourceStock(request: CheckResourceStockRequest): CheckResourceStockResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkResourceStockWithOptions(request, runtime);
}

model CreateAndroidInstanceGroupRequest {
  amount?: int32(name='Amount', description='The number of instance groups. Default value: 1. Maximum value: 1.', example='8'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: false.

Valid values:

*   true: enables automatic payment. Make sure that your Alibaba Cloud account has sufficient balance.
*   false: disables automatic payment. You must manually complete the payment.', example='false'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal. Default value: false.

Valid values:

*   true: automatically renew resource upon expiration.
*   false: manually renew resources upon expiration.', example='false'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region. You can call the DescribeRegions operation to query the regions where Cloud Phone is supported.

Valid values:

*   cn-shenzhen: China (Shenzhen).
*   cn-beijing: China (Beijing).
*   cn-shanghai: China (Shanghai).
*   cn-hongkong: China (Hong Kong).
*   ap-southeast-1: Singapore.
*   cn-hangzhou: China (Hangzhou).

This parameter is required.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PostPaid: pay-as-you-go.
*   PrePaid: subscription.', example='PostPaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. The value cannot exceed 100 characters in length.', example='asadbuvwiabdbvchjsbj'),
  enableIpv6?: boolean(name='EnableIpv6', description='>  This parameter is not publicly available.', example='null'),
  gpuAcceleration?: boolean(name='GpuAcceleration', description='Specifies whether to enable GPU acceleration.

Valid values:

*   true: enables GPU acceleration.
*   false (default): disables GPU acceleration.', example='false'),
  imageId?: string(name='ImageId', description='The ID of the image. You can call the [DescribeImageList](https://help.aliyun.com/document_detail/2807324.html) operation to query images.

This parameter is required.', example='imgc-06zyt9m93zwax****'),
  instanceGroupName?: string(name='InstanceGroupName', description='The name of the instance group.

>  The name can be up to 30 characters in length. It can contain letters, digits, colons (:), underscores (_), periods (.), or hyphens (-). It must start with letters but cannot start with `http://` or `https://`.', example='defaultInstanceGroup'),
  instanceGroupSpec?: string(name='InstanceGroupSpec', description='The specifications of the instance group. You can call the [DescribeSpec](https://help.aliyun.com/document_detail/2807299.html) operation to query the available specifications.

Valid values:

*   acp.perf.large: Performance (8 vCPUs, 16 GiB of memory, and 32 GiB of storage.
*   acp.basic.small: Lightweight (2 vCPUs, 4 GiB of memory, and 32 GiB of storage).
*   acp.std.large: Standard (4 vCPUs, 8 GiB of memory, and 32 GiB of storage).

This parameter is required.', example='acp.basic.small'),
  ipv6Bandwidth?: int32(name='Ipv6Bandwidth', description='>  This parameter is not publicly available.', example='null'),
  keyPairId?: string(name='KeyPairId', description='The ID of the key pair. When you create an instance group and specify a valid key pair ID, all cloud phone instances within the group will automatically be bound to that key pair upon creation. This eliminates the need to manually bind key pairs to individual cloud phone instances.

>  Binding key pairs to cloud phone instances is currently not supported during instance group resizing.', example='kp-7o9xywwfutc1l****'),
  numberOfInstances?: int32(name='NumberOfInstances', description='The number of cloud phones in the instance group. Maximum value: 100.', example='1'),
  officeSiteId?: string(name='OfficeSiteId', description='The ID of the network.

*   This parameter is required if you assign a shared network to cloud phones. You can go to the [Network](https://wya.wuying.aliyun.com/network) page of the Cloud Phone console to retrieve the ID of a **shared network**. If no shared network is available in the Cloud Phone console, you can leave this parameter empty. The system automatically creates one when you create an instance group.
*   This parameter is required if you assign a virtual private cloud (VPC) to cloud phones. You can go to the [Network](https://wya.wuying.aliyun.com/network) page of the Cloud Phone console to retrieve the ID of a **VPC**. If no VPC is available in the Cloud Phone console, you must first create one.', example='cn-hangzhou+dir-745976****'),
  period?: int32(name='Period', description='The subscription duration. The unit is specified by PeriodUnit.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration.

Valid values:

*   Month
*   Year
*   Hour (Note that this unit is supported only by pay-as-you-go.)', example='Month'),
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy. You can call the [ListPolicyGroups](https://help.aliyun.com/document_detail/2807352.html) operation to query policies.', example='pg-b7bxrrwxkijjh****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key'),
      value?: string(name='Value', description='The tag value.', example='value'),
    }
  ](name='Tag', description='The tags'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch. You can call the [DescribeVSwitches](https://help.aliyun.com/document_detail/448774.html) operation to query vSwitches.

*   This parameter is not required if you assign a shared network to cloud phones.
*   This parameter is required if you assign a VPC to cloud phones. The vSwitch specified by this parameter is used to create cloud phones.', example='vsw-uf61uvzhz8ejaw776****'),
}

model CreateAndroidInstanceGroupResponseBody = {
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
  instanceGroupInfos?: [ 
    {
      instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-cuv4scs4obxch****'),
      instanceIds?: [ string ](name='InstanceIds', description='The IDs of the instances.'),
    }
  ](name='InstanceGroupInfos', description='The instance groups.'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='22365781890****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1A923337-44D9-5CAD-9A53-95084BD4****'),
}

model CreateAndroidInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAndroidInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Creates pay-as-you-go or subscription instance groups.
 *
 * @description Before creating an instance group, ensure you understand the [billing methods](https://help.aliyun.com/document_detail/2807121.html) supported by Cloud Phone.
 * *   If the billing method of an instance group is PrePaid, AutoPay is set to false by default. In this case, you need to go to [Expenses and Costs](https://usercenter2-intl.aliyun.com/order/list) to manually complete the payment.
 * *   You can also set AutoPay to true based on your business requirements.
 *
 * @param request CreateAndroidInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAndroidInstanceGroupResponse
 */
async function createAndroidInstanceGroupWithOptions(request: CreateAndroidInstanceGroupRequest, runtime: Util.RuntimeOptions): CreateAndroidInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.amount)) {
    query['Amount'] = request.amount;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enableIpv6)) {
    query['EnableIpv6'] = request.enableIpv6;
  }
  if (!Util.isUnset(request.gpuAcceleration)) {
    query['GpuAcceleration'] = request.gpuAcceleration;
  }
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.instanceGroupName)) {
    query['InstanceGroupName'] = request.instanceGroupName;
  }
  if (!Util.isUnset(request.instanceGroupSpec)) {
    query['InstanceGroupSpec'] = request.instanceGroupSpec;
  }
  if (!Util.isUnset(request.ipv6Bandwidth)) {
    query['Ipv6Bandwidth'] = request.ipv6Bandwidth;
  }
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  if (!Util.isUnset(request.numberOfInstances)) {
    query['NumberOfInstances'] = request.numberOfInstances;
  }
  if (!Util.isUnset(request.officeSiteId)) {
    query['OfficeSiteId'] = request.officeSiteId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.policyGroupId)) {
    query['PolicyGroupId'] = request.policyGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAndroidInstanceGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates pay-as-you-go or subscription instance groups.
 *
 * @description Before creating an instance group, ensure you understand the [billing methods](https://help.aliyun.com/document_detail/2807121.html) supported by Cloud Phone.
 * *   If the billing method of an instance group is PrePaid, AutoPay is set to false by default. In this case, you need to go to [Expenses and Costs](https://usercenter2-intl.aliyun.com/order/list) to manually complete the payment.
 * *   You can also set AutoPay to true based on your business requirements.
 *
 * @param request CreateAndroidInstanceGroupRequest
 * @return CreateAndroidInstanceGroupResponse
 */
async function createAndroidInstanceGroup(request: CreateAndroidInstanceGroupRequest): CreateAndroidInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAndroidInstanceGroupWithOptions(request, runtime);
}

model CreateAppRequest {
  appName?: string(name='AppName', description='The name of the application.', example='Application Name 1'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region.', example='cn-hangzhou'),
  customAppInfo?: {
    apkSize?: string(name='ApkSize', description='The size of the .apk file. Unit: MB.', example='10'),
    downloadUrl?: string(name='DownloadUrl', description='The download URL of the app.', example='http://testApp.apk'),
    md5?: string(name='Md5', description='The MD5 value of the .apk file.', example='df3f46ce5844ddb278f14c5a9cd2****'),
    packageName?: string(name='PackageName', description='The name of the app package.', example='com.example.demo'),
    version?: string(name='Version', description='The version of the app.', example='1.0.0'),
    versionCode?: string(name='VersionCode', description='The code of the app version.', example='10000'),
  }(name='CustomAppInfo', description='The information about the custom app.

> 

*   If you want to pass in a custom app, configure the `CustomAppInfo` parameter. Take note that the six fields within it are mandatory.

*   A custom app has a higher priority than an app from the Alibaba Cloud Workspace Application Center. If you configure the `CustomAppInfo` parameter, the `FileName` and `FilePath` pair or the `OssAppUrl` will not take effect.'),
  description?: string(name='Description', description='The description of the application.', example='test'),
  fileName?: string(name='FileName', description='The name used by the app file in Object Storage Service (OSS). This parameter, combined with `FilePath`, uniquely identifies the OSS path of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [Elastic Desktop Service (EDS) Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.', example='testApp.apk'),
  filePath?: string(name='FilePath', description='The OSS bucket path to the app file. This parameter, combined with `FileName`, uniquely identifies the OSS path of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [EDS Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.'),
  iconUrl?: string(name='IconUrl', description='The icon URL of the application.', example='https://www.example.com/icon.png'),
  installParam?: string(name='InstallParam', description='The parameters used for installing the application. By default, the `-r` parameter is included when you install an application.', example='-d'),
  ossAppUrl?: string(name='OssAppUrl', description='The OSS bucket endpoint of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [EDS Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.', example='http://testApp.apk'),
  signApk?: string(name='SignApk'),
}

model CreateAppShrinkRequest {
  appName?: string(name='AppName', description='The name of the application.', example='Application Name 1'),
  bizRegionId?: string(name='BizRegionId', description='The ID of the region.', example='cn-hangzhou'),
  customAppInfoShrink?: string(name='CustomAppInfo', description='The information about the custom app.

> 

*   If you want to pass in a custom app, configure the `CustomAppInfo` parameter. Take note that the six fields within it are mandatory.

*   A custom app has a higher priority than an app from the Alibaba Cloud Workspace Application Center. If you configure the `CustomAppInfo` parameter, the `FileName` and `FilePath` pair or the `OssAppUrl` will not take effect.'),
  description?: string(name='Description', description='The description of the application.', example='test'),
  fileName?: string(name='FileName', description='The name used by the app file in Object Storage Service (OSS). This parameter, combined with `FilePath`, uniquely identifies the OSS path of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [Elastic Desktop Service (EDS) Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.', example='testApp.apk'),
  filePath?: string(name='FilePath', description='The OSS bucket path to the app file. This parameter, combined with `FileName`, uniquely identifies the OSS path of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [EDS Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.'),
  iconUrl?: string(name='IconUrl', description='The icon URL of the application.', example='https://www.example.com/icon.png'),
  installParam?: string(name='InstallParam', description='The parameters used for installing the application. By default, the `-r` parameter is included when you install an application.', example='-d'),
  ossAppUrl?: string(name='OssAppUrl', description='The OSS bucket endpoint of the app file.

> 

*   If you want to pass in an app from the Alibaba Cloud Workspace Application Center, configure the `FileName` and `FilePath` parameters. Alternatively, configure the `OssAppUrl` parameter. The FileName and FilePath parameters takes precedence over the OssAppUrl parameter.

*   Log on to the [EDS Enterprise](https://eds.console.aliyun.com/osshelp) console, upload the app file to the Application Center according to the on-screen instructions, and then retrieve the parameter value.', example='http://testApp.apk'),
  signApk?: string(name='SignApk'),
}

model CreateAppResponseBody = {
  appId?: int32(name='AppId', description='The ID of the application.', example='1234'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5138F7E-46B5-526A-8C99-82DEAE6B****'),
}

model CreateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppResponseBody(name='body'),
}

/**
 * @summary Creates an Android application.
 *
 * @description When creating an app, you can provide app information to the system in one of the following ways:
 * *   Way 1: Apps from the Application Center
 *     *   You can use one of the following methods:
 *         *   Method 1: Pass in the `FileName` and `FilePath` parameters at the same time.
 *         *   Method 2: Pass in the `OssAppUrl` parameter
 *     *   Rule: If your app is from the Alibaba Cloud Workspace Application Center, you must use either Method 1 or Method 2. If both are used, Method 1 takes priority.
 *     *   Condition: Before you proceed, log on to the [Elastic Desktop Service (EDS) Enterprise console](https://eds.console.aliyun.com/osshelp) and follow the on-screen instructions to upload the app file to the Application Center to obtain the values of the `FileName`, `FilePath`, and `OssAppUrl` parameters.
 * *   Way 2: Custom apps
 *     *   Pass in the `CustomAppInfo` parameter.
 *     *   Rule: If you pass in the `CustomAppInfo` parameter, all six fields within it are required.
 * >  If Way 1 and Way 2 are adopted simultaneously, the information from Way 2 takes priority.
 *
 * @param tmpReq CreateAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppResponse
 */
async function createAppWithOptions(tmpReq: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAppShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.customAppInfo)) {
    request.customAppInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customAppInfo, 'CustomAppInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.customAppInfoShrink)) {
    query['CustomAppInfo'] = request.customAppInfoShrink;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.iconUrl)) {
    query['IconUrl'] = request.iconUrl;
  }
  if (!Util.isUnset(request.installParam)) {
    query['InstallParam'] = request.installParam;
  }
  if (!Util.isUnset(request.ossAppUrl)) {
    query['OssAppUrl'] = request.ossAppUrl;
  }
  if (!Util.isUnset(request.signApk)) {
    query['SignApk'] = request.signApk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an Android application.
 *
 * @description When creating an app, you can provide app information to the system in one of the following ways:
 * *   Way 1: Apps from the Application Center
 *     *   You can use one of the following methods:
 *         *   Method 1: Pass in the `FileName` and `FilePath` parameters at the same time.
 *         *   Method 2: Pass in the `OssAppUrl` parameter
 *     *   Rule: If your app is from the Alibaba Cloud Workspace Application Center, you must use either Method 1 or Method 2. If both are used, Method 1 takes priority.
 *     *   Condition: Before you proceed, log on to the [Elastic Desktop Service (EDS) Enterprise console](https://eds.console.aliyun.com/osshelp) and follow the on-screen instructions to upload the app file to the Application Center to obtain the values of the `FileName`, `FilePath`, and `OssAppUrl` parameters.
 * *   Way 2: Custom apps
 *     *   Pass in the `CustomAppInfo` parameter.
 *     *   Rule: If you pass in the `CustomAppInfo` parameter, all six fields within it are required.
 * >  If Way 1 and Way 2 are adopted simultaneously, the information from Way 2 takes priority.
 *
 * @param request CreateAppRequest
 * @return CreateAppResponse
 */
async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateCloudPhoneNodeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature.

Valid values:

*   False (default): You must manually complete the payment in the Alibaba Cloud Expenses and Costs console.
*   true: enables the auto-payment feature.', example='true'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable the auto-renewal feature.

Valid values:

*   true: enables the auto-renewal feature. In this case, the system automatically renews instances upon expiration.
*   false (default): disables the auto-renewal feature. In this case, you need to manually renew instances upon expiration.', example='true'),
  bizRegionId?: string(name='BizRegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method. Only the subscription billing method is supported.', example='PrePaid'),
  count?: string(name='Count', description='The number of cloud phone matrixes you want to purchase.', example='1'),
  displayConfig?: {
    dpi?: int32(name='Dpi'),
    fps?: int32(name='Fps'),
    lockResolution?: string(name='LockResolution'),
  }(name='DisplayConfig'),
  imageId?: string(name='ImageId', description='The image ID.', example='imgc-075cllfeuazh0****'),
  instanceType?: string(name='InstanceType', description='The instance specification.

Valid values:

*   ac.max: By default, this specification allows up to 25 instances. You can adjust this number by using PhoneCount (Value range: 4 to 40).
*   ac.plus: By default, this specification allows up to 40 instances. You can adjust this number by using PhoneCount (Value range: 4 to 40).', example='ac.max'),
  networkId?: string(name='NetworkId', description='The office network ID.', example='cn-hangzhou+dir-5mwr9azebliva****'),
  nodeName?: string(name='NodeName', description='The name of the cloud phone matrix.', example='node_name'),
  period?: int32(name='Period', description='The subscription duration. The unit is specified by `PeriodUnit`. Valid values:

*   When `PeriodUnit` is set to **year**: 1.
*   When `PeriodUnit` is set to **month**: 1, 2, 3, and 6.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration.

Valid values:

*   Month (default)
*   Year', example='Month'),
  phoneCount?: int32(name='PhoneCount', description='The number of instances per cloud phone matrix.', example='25'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The resolution height. Unit: pixel.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The resolution width. Unit: pixel.', example='720'),
  serverShareDataVolume?: int32(name='ServerShareDataVolume', description='The shared storage size Unit: GiB.', example='200'),
  serverType?: string(name='ServerType', description='The matrix specification.

Valid values:

*   cpm.gn6.gx1

This parameter is required.', example='cpm.gn6.gx1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='keyname'),
      value?: string(name='Value', description='The tag value.', example='valuename'),
    }
  ](name='Tag', description='The resource tags.'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-2zeekryyc1q3sm72l****'),
}

model CreateCloudPhoneNodeShrinkRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature.

Valid values:

*   False (default): You must manually complete the payment in the Alibaba Cloud Expenses and Costs console.
*   true: enables the auto-payment feature.', example='true'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable the auto-renewal feature.

Valid values:

*   true: enables the auto-renewal feature. In this case, the system automatically renews instances upon expiration.
*   false (default): disables the auto-renewal feature. In this case, you need to manually renew instances upon expiration.', example='true'),
  bizRegionId?: string(name='BizRegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method. Only the subscription billing method is supported.', example='PrePaid'),
  count?: string(name='Count', description='The number of cloud phone matrixes you want to purchase.', example='1'),
  displayConfigShrink?: string(name='DisplayConfig'),
  imageId?: string(name='ImageId', description='The image ID.', example='imgc-075cllfeuazh0****'),
  instanceType?: string(name='InstanceType', description='The instance specification.

Valid values:

*   ac.max: By default, this specification allows up to 25 instances. You can adjust this number by using PhoneCount (Value range: 4 to 40).
*   ac.plus: By default, this specification allows up to 40 instances. You can adjust this number by using PhoneCount (Value range: 4 to 40).', example='ac.max'),
  networkId?: string(name='NetworkId', description='The office network ID.', example='cn-hangzhou+dir-5mwr9azebliva****'),
  nodeName?: string(name='NodeName', description='The name of the cloud phone matrix.', example='node_name'),
  period?: int32(name='Period', description='The subscription duration. The unit is specified by `PeriodUnit`. Valid values:

*   When `PeriodUnit` is set to **year**: 1.
*   When `PeriodUnit` is set to **month**: 1, 2, 3, and 6.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration.

Valid values:

*   Month (default)
*   Year', example='Month'),
  phoneCount?: int32(name='PhoneCount', description='The number of instances per cloud phone matrix.', example='25'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The resolution height. Unit: pixel.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The resolution width. Unit: pixel.', example='720'),
  serverShareDataVolume?: int32(name='ServerShareDataVolume', description='The shared storage size Unit: GiB.', example='200'),
  serverType?: string(name='ServerType', description='The matrix specification.

Valid values:

*   cpm.gn6.gx1

This parameter is required.', example='cpm.gn6.gx1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='keyname'),
      value?: string(name='Value', description='The tag value.', example='valuename'),
    }
  ](name='Tag', description='The resource tags.'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-2zeekryyc1q3sm72l****'),
}

model CreateCloudPhoneNodeResponseBody = {
  nodeInfos?: [ 
    {
      instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances.'),
      nodeId?: string(name='NodeId', description='The ID of the cloud phone matrix.', example='cpn-e5kxgjyt8s1mb****'),
    }
  ](name='NodeInfos', description='The cloud phone matrixes.'),
  orderId?: string(name='OrderId', description='The order ID.', example='223684716098****'),
  requestId?: string(name='RequestId', description='The request ID.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model CreateCloudPhoneNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCloudPhoneNodeResponseBody(name='body'),
}

/**
 * @summary Creates a cloud phone matrix.
 *
 * @param tmpReq CreateCloudPhoneNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCloudPhoneNodeResponse
 */
async function createCloudPhoneNodeWithOptions(tmpReq: CreateCloudPhoneNodeRequest, runtime: Util.RuntimeOptions): CreateCloudPhoneNodeResponse {
  Util.validateModel(tmpReq);
  var request = new CreateCloudPhoneNodeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.displayConfig)) {
    request.displayConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.displayConfig, 'DisplayConfig', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.count)) {
    query['Count'] = request.count;
  }
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.networkId)) {
    query['NetworkId'] = request.networkId;
  }
  if (!Util.isUnset(request.nodeName)) {
    query['NodeName'] = request.nodeName;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.phoneCount)) {
    query['PhoneCount'] = request.phoneCount;
  }
  if (!Util.isUnset(request.resolutionHeight)) {
    query['ResolutionHeight'] = request.resolutionHeight;
  }
  if (!Util.isUnset(request.resolutionWidth)) {
    query['ResolutionWidth'] = request.resolutionWidth;
  }
  if (!Util.isUnset(request.serverShareDataVolume)) {
    query['ServerShareDataVolume'] = request.serverShareDataVolume;
  }
  if (!Util.isUnset(request.serverType)) {
    query['ServerType'] = request.serverType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.displayConfigShrink)) {
    body['DisplayConfig'] = request.displayConfigShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCloudPhoneNode',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a cloud phone matrix.
 *
 * @param request CreateCloudPhoneNodeRequest
 * @return CreateCloudPhoneNodeResponse
 */
async function createCloudPhoneNode(request: CreateCloudPhoneNodeRequest): CreateCloudPhoneNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCloudPhoneNodeWithOptions(request, runtime);
}

model CreateCustomImageRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. By default, this parameter is left empty. The token cannot exceed 64 characters in length.', example='20393E53-8FF1-524C-B494-B478A5369733'),
  description?: string(name='Description', description='The description of the custom image.', example='create for cc5g group auth rules test'),
  imageName?: string(name='ImageName', description='The name of the custom image.

This parameter is required.', example='custom image name'),
  instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance.

This parameter is required.', example='acp-2zecay9ponatdc4m****'),
}

model CreateCustomImageResponseBody = {
  imageId?: string(name='ImageId', description='The ID of the custom image.', example='imgc-075cllfeuazh0****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='20393E53-8FF1-524C-B494-B478A5369733'),
}

model CreateCustomImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCustomImageResponseBody(name='body'),
}

/**
 * @summary Creates a custom image from a cloud phone instance.
 *
 * @param request CreateCustomImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCustomImageResponse
 */
async function createCustomImageWithOptions(request: CreateCustomImageRequest, runtime: Util.RuntimeOptions): CreateCustomImageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.imageName)) {
    body['ImageName'] = request.imageName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomImage',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a custom image from a cloud phone instance.
 *
 * @param request CreateCustomImageRequest
 * @return CreateCustomImageResponse
 */
async function createCustomImage(request: CreateCustomImageRequest): CreateCustomImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomImageWithOptions(request, runtime);
}

model CreateKeyPairRequest {
  keyPairName?: string(name='KeyPairName', description='The name of the key pair. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

This parameter is required.', example='testKeyPairName'),
}

model CreateKeyPairResponseBody = {
  data?: {
    gmtCreated?: string(name='GmtCreated', description='The time when the key pair was created.', example='2024-06-30 08:45:09.0'),
    keyPairId?: string(name='KeyPairId', description='The ID of the key pair.', example='kp-6v2q33ae4tw3*****'),
    keyPairName?: string(name='KeyPairName', description='The name of the key pair.', example='testKeyPairName'),
    privateKeyBody?: string(name='PrivateKeyBody', description='The private key of the key pair. The PEM-encoded private key that is in PKCS#8 format and adheres to the ADB connection specification.', example='MIIEpAIBAAKCAQEAtReyMzLIcBH78EV2zj****'),
  }(name='Data', description='The objects that are returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model CreateKeyPairResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateKeyPairResponseBody(name='body'),
}

/**
 * @summary Creates an Android Debug Bridge (ADB) key pair. The system retains the public key and provides a PEM-encoded private key in PKCS#8 format, adhering to the ADB connection specification. You must securely store the private key.
 *
 * @description In addition to using the CreateKeyPair operation to generate a key pair, you can also create one by using the ADB tool and upload it to the Cloud Phone console. The usage of this key pair is identical to that of a system-generated key pair.
 * Each tenant can create up to 500 key pairs.
 *
 * @param request CreateKeyPairRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateKeyPairResponse
 */
async function createKeyPairWithOptions(request: CreateKeyPairRequest, runtime: Util.RuntimeOptions): CreateKeyPairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyPairName)) {
    query['KeyPairName'] = request.keyPairName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateKeyPair',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an Android Debug Bridge (ADB) key pair. The system retains the public key and provides a PEM-encoded private key in PKCS#8 format, adhering to the ADB connection specification. You must securely store the private key.
 *
 * @description In addition to using the CreateKeyPair operation to generate a key pair, you can also create one by using the ADB tool and upload it to the Cloud Phone console. The usage of this key pair is identical to that of a system-generated key pair.
 * Each tenant can create up to 500 key pairs.
 *
 * @param request CreateKeyPairRequest
 * @return CreateKeyPairResponse
 */
async function createKeyPair(request: CreateKeyPairRequest): CreateKeyPairResponse {
  var runtime = new Util.RuntimeOptions{};
  return createKeyPairWithOptions(request, runtime);
}

model CreatePolicyGroupRequest {
  cameraRedirect?: string(name='CameraRedirect', description='Specifies whether to enable the webcam redirection feature.

Valid values:

*   off
*   on', example='off'),
  clipboard?: string(name='Clipboard', description='The read/write permissions on the clipboard.

Valid values:

*   read: read-only.
*   readwrite: read and write.
*   off: read/write disabled.', example='readwrite'),
  html5FileTransfer?: string(name='Html5FileTransfer', description='The file transfer policy of the Alibaba Cloud Workspace web client.

Valid values:

*   all: File upload and download are supported.
*   download: Only file download is supported.
*   upload: Only file upload is supported.
*   off: File upload or download is forbidden.', example='off'),
  localDrive?: string(name='LocalDrive', description='The read/write permissions on the on-premises drive.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='off'),
  lockResolution?: string(name='LockResolution', description='Specifies whether to lock the resolution.

Valid values:

*   off
*   on', example='off'),
  netRedirectPolicy?: {
    customProxy?: string(name='CustomProxy', description='Specifies whether to manually configure a custom proxy.

Valid values:

*   off
*   on', example='off'),
    hostAddr?: string(name='HostAddr', description='The IPv4 address of the custom proxy.', example='47.100.XX.XX'),
    netRedirect?: string(name='NetRedirect', description='Specifies whether to enable the network redirection feature.

Valid values:

*   off
*   on', example='off'),
    port?: string(name='Port', description='The port of the custom proxy. Valid values: 1 to 65535.', example='1145'),
    proxyPassword?: string(name='ProxyPassword', description='The password of the proxy. The password must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='password'),
    proxyType?: string(name='ProxyType', description='The type of the proxy protocol.

Valid values:

*   socks5.', example='socks5'),
    proxyUserName?: string(name='ProxyUserName', description='The username of the proxy. The name must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='username'),
    rules?: [ 
      {
        ruleType?: string(name='RuleType', description='The type of the rule.

Valid values:

*   prc: an application package name.
*   domain: a domain name.', example='domain'),
        target?: string(name='Target', description='The name of the application package or domain name.', example='*.example.com'),
      }
    ](name='Rules', description='The proxy rules. You can create up to 100 proxy rules.'),
  }(name='NetRedirectPolicy', description='The network redirection policy.'),
  policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='defaultPolicy'),
  policyType?: string(name='PolicyType'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution. Unit: pixels.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution. Unit: pixels.', example='720'),
  watermark?: {
    watermarkColor?: int32(name='WatermarkColor'),
    watermarkCustomText?: string(name='WatermarkCustomText'),
    watermarkFontSize?: int32(name='WatermarkFontSize'),
    watermarkSwitch?: string(name='WatermarkSwitch'),
    watermarkTransparencyValue?: int32(name='WatermarkTransparencyValue'),
    watermarkTypes?: [ string ](name='WatermarkTypes'),
  }(name='Watermark'),
}

model CreatePolicyGroupShrinkRequest {
  cameraRedirect?: string(name='CameraRedirect', description='Specifies whether to enable the webcam redirection feature.

Valid values:

*   off
*   on', example='off'),
  clipboard?: string(name='Clipboard', description='The read/write permissions on the clipboard.

Valid values:

*   read: read-only.
*   readwrite: read and write.
*   off: read/write disabled.', example='readwrite'),
  html5FileTransfer?: string(name='Html5FileTransfer', description='The file transfer policy of the Alibaba Cloud Workspace web client.

Valid values:

*   all: File upload and download are supported.
*   download: Only file download is supported.
*   upload: Only file upload is supported.
*   off: File upload or download is forbidden.', example='off'),
  localDrive?: string(name='LocalDrive', description='The read/write permissions on the on-premises drive.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='off'),
  lockResolution?: string(name='LockResolution', description='Specifies whether to lock the resolution.

Valid values:

*   off
*   on', example='off'),
  netRedirectPolicyShrink?: string(name='NetRedirectPolicy', description='The network redirection policy.'),
  policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='defaultPolicy'),
  policyType?: string(name='PolicyType'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution. Unit: pixels.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution. Unit: pixels.', example='720'),
  watermarkShrink?: string(name='Watermark'),
}

model CreatePolicyGroupResponseBody = {
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-exbuu6yrpvb******'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC******'),
}

model CreatePolicyGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePolicyGroupResponseBody(name='body'),
}

/**
 * @summary Creates a policy.
 *
 * @param tmpReq CreatePolicyGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePolicyGroupResponse
 */
async function createPolicyGroupWithOptions(tmpReq: CreatePolicyGroupRequest, runtime: Util.RuntimeOptions): CreatePolicyGroupResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePolicyGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.netRedirectPolicy)) {
    request.netRedirectPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.netRedirectPolicy, 'NetRedirectPolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.watermark)) {
    request.watermarkShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.watermark, 'Watermark', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.cameraRedirect)) {
    body['CameraRedirect'] = request.cameraRedirect;
  }
  if (!Util.isUnset(request.clipboard)) {
    body['Clipboard'] = request.clipboard;
  }
  if (!Util.isUnset(request.html5FileTransfer)) {
    body['Html5FileTransfer'] = request.html5FileTransfer;
  }
  if (!Util.isUnset(request.localDrive)) {
    body['LocalDrive'] = request.localDrive;
  }
  if (!Util.isUnset(request.lockResolution)) {
    body['LockResolution'] = request.lockResolution;
  }
  if (!Util.isUnset(request.netRedirectPolicyShrink)) {
    body['NetRedirectPolicy'] = request.netRedirectPolicyShrink;
  }
  if (!Util.isUnset(request.policyGroupName)) {
    body['PolicyGroupName'] = request.policyGroupName;
  }
  if (!Util.isUnset(request.policyType)) {
    body['PolicyType'] = request.policyType;
  }
  if (!Util.isUnset(request.resolutionHeight)) {
    body['ResolutionHeight'] = request.resolutionHeight;
  }
  if (!Util.isUnset(request.resolutionWidth)) {
    body['ResolutionWidth'] = request.resolutionWidth;
  }
  if (!Util.isUnset(request.watermarkShrink)) {
    body['Watermark'] = request.watermarkShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePolicyGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a policy.
 *
 * @param request CreatePolicyGroupRequest
 * @return CreatePolicyGroupResponse
 */
async function createPolicyGroup(request: CreatePolicyGroupRequest): CreatePolicyGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPolicyGroupWithOptions(request, runtime);
}

model CreateScreenshotRequest {
  androidInstanceIdList?: [ string ](name='AndroidInstanceIdList', description='The IDs of the cloud phone instances. You can create multiple snapshots simultaneously.

This parameter is required.'),
  ossBucketName?: string(name='OssBucketName', description='The name of the OSS bucket. The name must start with "cloudphone-saved-bucket-". The OSS bucket and the cloud phone instance must be in the same region. If you leave this parameter empty, the system will create a default OSS bucket named “cloudphone-saved-bucket-{Region of the cloud phone instance}-{AliUid}.”', example='cloudphone-saved-bucket-cn-shanghai-default'),
  skipCheckPolicyConfig?: string(name='SkipCheckPolicyConfig', description='Specifies whether to bypass the snapshot policy control. Default value: false.', example='false'),
}

model CreateScreenshotResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request. If the request fails, share this ID with technical support to help diagnose the issue.', example='3AF82CE1-2801-52CE-BF64-B491DD7C****'),
  tasks?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the cloud phone instance.', example='acp-bwhtebzah2fse****'),
      taskId?: string(name='TaskId', description='The ID of the task. You can use the task ID with the DescribeTasks operation to get the download link for the screenshot.', example='t-imr0fufqd7cle****'),
    }
  ](name='Tasks', description='The tasks.'),
}

model CreateScreenshotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateScreenshotResponseBody(name='body'),
}

/**
 * @summary Creates a screenshot of a cloud phone instance.
 *
 * @description You can call this operation to create a screenshot of a cloud phone instance and upload it to the default Object Storage Service (OSS) bucket. The operation returns a task ID, which you can use with the DescribeTasks operation to get the download link for the screenshot.
 *
 * @param request CreateScreenshotRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateScreenshotResponse
 */
async function createScreenshotWithOptions(request: CreateScreenshotRequest, runtime: Util.RuntimeOptions): CreateScreenshotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIdList)) {
    query['AndroidInstanceIdList'] = request.androidInstanceIdList;
  }
  if (!Util.isUnset(request.ossBucketName)) {
    query['OssBucketName'] = request.ossBucketName;
  }
  if (!Util.isUnset(request.skipCheckPolicyConfig)) {
    query['SkipCheckPolicyConfig'] = request.skipCheckPolicyConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateScreenshot',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a screenshot of a cloud phone instance.
 *
 * @description You can call this operation to create a screenshot of a cloud phone instance and upload it to the default Object Storage Service (OSS) bucket. The operation returns a task ID, which you can use with the DescribeTasks operation to get the download link for the screenshot.
 *
 * @param request CreateScreenshotRequest
 * @return CreateScreenshotResponse
 */
async function createScreenshot(request: CreateScreenshotRequest): CreateScreenshotResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScreenshotWithOptions(request, runtime);
}

model DeleteAndroidInstanceGroupRequest {
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
}

model DeleteAndroidInstanceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB95E410-FD1D-53C5-9F7D-93CC44D7****'),
}

model DeleteAndroidInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAndroidInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Delete an instance group.
 *
 * @description You can delete only pay-as-you-go instance groups.
 * You can delete subscription instance groups only after they expire.
 *
 * @param request DeleteAndroidInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAndroidInstanceGroupResponse
 */
async function deleteAndroidInstanceGroupWithOptions(request: DeleteAndroidInstanceGroupRequest, runtime: Util.RuntimeOptions): DeleteAndroidInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceGroupIds)) {
    query['InstanceGroupIds'] = request.instanceGroupIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAndroidInstanceGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete an instance group.
 *
 * @description You can delete only pay-as-you-go instance groups.
 * You can delete subscription instance groups only after they expire.
 *
 * @param request DeleteAndroidInstanceGroupRequest
 * @return DeleteAndroidInstanceGroupResponse
 */
async function deleteAndroidInstanceGroup(request: DeleteAndroidInstanceGroupRequest): DeleteAndroidInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAndroidInstanceGroupWithOptions(request, runtime);
}

model DeleteAppsRequest {
  appIdList?: [ string ](name='AppIdList', description='The IDs of the applications.'),
}

model DeleteAppsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='310A783E-CC46-5452-A8A3-71AE5DB5****'),
}

model DeleteAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppsResponseBody(name='body'),
}

/**
 * @summary Deletes an application. Before you delete an application, make sure that the application is not installed on any instances.
 *
 * @param request DeleteAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppsResponse
 */
async function deleteAppsWithOptions(request: DeleteAppsRequest, runtime: Util.RuntimeOptions): DeleteAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appIdList)) {
    query['AppIdList'] = request.appIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApps',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application. Before you delete an application, make sure that the application is not installed on any instances.
 *
 * @param request DeleteAppsRequest
 * @return DeleteAppsResponse
 */
async function deleteApps(request: DeleteAppsRequest): DeleteAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppsWithOptions(request, runtime);
}

model DeleteCloudPhoneNodesRequest {
  nodeIds?: [ string ](name='NodeIds', description='The cloud phone matrix IDs.'),
}

model DeleteCloudPhoneNodesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC****'),
}

model DeleteCloudPhoneNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCloudPhoneNodesResponseBody(name='body'),
}

/**
 * @summary Deletes a cloud phone matrix.
 *
 * @description Before you proceed, make sure that the cloud phone matrix that you want to delete expired.
 *
 * @param request DeleteCloudPhoneNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCloudPhoneNodesResponse
 */
async function deleteCloudPhoneNodesWithOptions(request: DeleteCloudPhoneNodesRequest, runtime: Util.RuntimeOptions): DeleteCloudPhoneNodesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.nodeIds)) {
    body['NodeIds'] = request.nodeIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCloudPhoneNodes',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a cloud phone matrix.
 *
 * @description Before you proceed, make sure that the cloud phone matrix that you want to delete expired.
 *
 * @param request DeleteCloudPhoneNodesRequest
 * @return DeleteCloudPhoneNodesResponse
 */
async function deleteCloudPhoneNodes(request: DeleteCloudPhoneNodesRequest): DeleteCloudPhoneNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCloudPhoneNodesWithOptions(request, runtime);
}

model DeleteImagesRequest {
  imageIds?: [ string ](name='ImageIds', description='The IDs of the images.

This parameter is required.'),
}

model DeleteImagesShrinkRequest {
  imageIdsShrink?: string(name='ImageIds', description='The IDs of the images.

This parameter is required.'),
}

model DeleteImagesResponseBody = {
  data?: {
    failDeleteImageIds?: [ string ](name='FailDeleteImageIds', description='The IDs of the images that failed to be deleted.'),
    successDeleteImageIds?: [ string ](name='SuccessDeleteImageIds', description='The IDs of the images that are successfully deleted.'),
  }(name='Data', description='The images.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4610632D-D661-5982-B3D7-5D3FD183F595'),
}

model DeleteImagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteImagesResponseBody(name='body'),
}

/**
 * @summary Deletes a custom image.
 *
 * @description You cannot delete an image that is currently in use by an instance group.
 *
 * @param tmpReq DeleteImagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteImagesResponse
 */
async function deleteImagesWithOptions(tmpReq: DeleteImagesRequest, runtime: Util.RuntimeOptions): DeleteImagesResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteImagesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.imageIds)) {
    request.imageIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.imageIds, 'ImageIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageIdsShrink)) {
    body['ImageIds'] = request.imageIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteImages',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a custom image.
 *
 * @description You cannot delete an image that is currently in use by an instance group.
 *
 * @param request DeleteImagesRequest
 * @return DeleteImagesResponse
 */
async function deleteImages(request: DeleteImagesRequest): DeleteImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteImagesWithOptions(request, runtime);
}

model DeleteKeyPairsRequest {
  keyPairIds?: [ string ](name='KeyPairIds', description='The IDs of the ADB key pairs.'),
}

model DeleteKeyPairsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5C5CEF0A-D6E1-58D3-8750-67DB4F82****'),
}

model DeleteKeyPairsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteKeyPairsResponseBody(name='body'),
}

/**
 * @summary Deletes Android Debug Bridge (ADB) key pairs.
 *
 * @description *   If a cloud phone instance is currently associated with the ADB key pair you intend to delete, the ADB key pair cannot be deleted.
 * *   Once an ADB key pair is deleted, it cannot be retrieved or queried by using the DescribeKeyPairs operation.
 *
 * @param request DeleteKeyPairsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteKeyPairsResponse
 */
async function deleteKeyPairsWithOptions(request: DeleteKeyPairsRequest, runtime: Util.RuntimeOptions): DeleteKeyPairsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyPairIds)) {
    query['KeyPairIds'] = request.keyPairIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteKeyPairs',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes Android Debug Bridge (ADB) key pairs.
 *
 * @description *   If a cloud phone instance is currently associated with the ADB key pair you intend to delete, the ADB key pair cannot be deleted.
 * *   Once an ADB key pair is deleted, it cannot be retrieved or queried by using the DescribeKeyPairs operation.
 *
 * @param request DeleteKeyPairsRequest
 * @return DeleteKeyPairsResponse
 */
async function deleteKeyPairs(request: DeleteKeyPairsRequest): DeleteKeyPairsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteKeyPairsWithOptions(request, runtime);
}

model DeletePolicyGroupRequest {
  policyGroupIds?: [ string ](name='PolicyGroupIds', description='The IDs of the policies.

This parameter is required.'),
}

model DeletePolicyGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='17C731AB-AAEE-5844-A352-D8D0352D3F0B'),
}

model DeletePolicyGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePolicyGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a policy.
 *
 * @param request DeletePolicyGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePolicyGroupResponse
 */
async function deletePolicyGroupWithOptions(request: DeletePolicyGroupRequest, runtime: Util.RuntimeOptions): DeletePolicyGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.policyGroupIds)) {
    query['PolicyGroupIds'] = request.policyGroupIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePolicyGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a policy.
 *
 * @param request DeletePolicyGroupRequest
 * @return DeletePolicyGroupResponse
 */
async function deletePolicyGroup(request: DeletePolicyGroupRequest): DeletePolicyGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePolicyGroupWithOptions(request, runtime);
}

model DescribeAndroidInstanceGroupsRequest {
  bizRegionId?: string(name='BizRegionId', description='The ID of the region.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PrePaid: subscription
*   PostPaid: pay-as-you-go', example='PostPaid'),
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
  instanceGroupName?: string(name='InstanceGroupName', description='The name of the instance group. Instance groups support fuzzy search by name.', example='defaultInstanceGroup'),
  keyPairId?: string(name='KeyPairId', description='The ID of the key pair.', example='kp-5htf0ymsrnb7q****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Value range: 0 to 100. Default value: 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uONHqPtDLM2U8s****'),
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-1b77w6xrqfubi****'),
  saleMode?: string(name='SaleMode', description='The purchase mode of cloud phone instances.

Valid values:

*   Instance (default): the instance group mode.
*   Node: the matrix mode [whitelisted].', example='standard'),
  status?: string(name='Status', description='The status of the instance group.

Valid values:

*   UPDATING_FAILED: The image update for the instance group failed.
*   FAILED: The instance group failed to be created.
*   RUNNING: The instance group is available.
*   EXPIRED: The instance group expired.
*   DELETING: The instance group is being deleted.
*   DELETED: The instance group is deleted.
*   UPDATING: The instance group is undergoing an image update.
*   CREATING: The instance group is being created.', example='CREATING'),
}

model DescribeAndroidInstanceGroupsResponseBody = {
  instanceGroupModel?: [ 
    {
      appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-48xr63m4dybjk****'),
      architectureType?: string(name='ArchitectureType', description='The type of the architecture.', example='ARM'),
      availableInstanceAmount?: int32(name='AvailableInstanceAmount', description='The number of available instances.

>  Available instances are those not in the Deleting or Deleted state.', example='5'),
      chargeType?: string(name='ChargeType', description='The billing method.', example='PrePaid'),
      cpu?: string(name='Cpu', description='The number of vCPUs.', example='8'),
      disks?: [ 
        {
          diskSize?: int32(name='DiskSize', description='The size of the disk. Unit: GB.', example='32'),
          diskType?: string(name='DiskType', description='The type of the disk.', example='SYSTEM'),
        }
      ](name='Disks', description='The disks.'),
      enableIpv6?: boolean(name='EnableIpv6', example='true'),
      errorCode?: string(name='ErrorCode', description='The cause of the creation failure.', example='0'),
      gmtCreate?: string(name='GmtCreate', description='The time when the instance group was created.', example='2024-02-01 10:56:36'),
      gmtExpired?: string(name='GmtExpired', description='The time when the subscription instance group expires.', example='2027-06-29 07:25:31'),
      gmtModified?: string(name='GmtModified', description='The time when the instance group was updated.', example='2024-02-01 10:56:36'),
      imageId?: string(name='ImageId', description='The ID of the image.', example='imgc-06zyt9m93zwax****'),
      installedAppList?: string(name='InstalledAppList', description='The list of installed applications.', example='"TikTok","WeChat"'),
      instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-h67a2cs0zprfdh****'),
      instanceGroupName?: string(name='InstanceGroupName', description='The name of the instance group.', example='defaultInstanceGroup'),
      instanceGroupSpec?: string(name='InstanceGroupSpec', description='The specifications of the instance group.', example='acp.basic.small'),
      instanceGroupSpecDescribe?: string(name='InstanceGroupSpecDescribe', description='The description of the instance group specifications.', example='ARM-2vCPU4GiB 32GiB'),
      instanceGroupStatus?: string(name='InstanceGroupStatus', description='The status of the instance group.', example='RUNNING'),
      ipv6Bandwidth?: int32(name='Ipv6Bandwidth', example='50'),
      memory?: int32(name='Memory', description='The memory size.', example='8'),
      numberOfInstances?: string(name='NumberOfInstances', description='The number of instances in the instance group.', example='10'),
      officeSiteId?: string(name='OfficeSiteId', description='The ID of the network.', example='cn-shanghai+dir-030598****'),
      policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-c6n38xucps8kl****'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
      renderingType?: string(name='RenderingType', description='The rendering mode of the instance group.

Valid values:

*   GPURemote: GPU remote rendering.
*   CPU: CPU rendering.
*   GPUocal: GPU local rendering.', example='CPU'),
      resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution.', example='1280'),
      resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution.', example='720'),
      saleMode?: string(name='SaleMode', description='The sales mode.', example='standard'),
      systemVersion?: string(name='SystemVersion', description='The version of the operating system.', example='Android 12'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-t4n0yqs009ho024wt****'),
    }
  ](name='InstanceGroupModel', description='The instance group.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uONHqPtDLM2U8s****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F07A1DA1-E1EB-5CCA-8EED-12F85D32****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeAndroidInstanceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAndroidInstanceGroupsResponseBody(name='body'),
}

/**
 * @summary Queries the details of an instance group.
 *
 * @param request DescribeAndroidInstanceGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAndroidInstanceGroupsResponse
 */
async function describeAndroidInstanceGroupsWithOptions(request: DescribeAndroidInstanceGroupsRequest, runtime: Util.RuntimeOptions): DescribeAndroidInstanceGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.instanceGroupIds)) {
    query['InstanceGroupIds'] = request.instanceGroupIds;
  }
  if (!Util.isUnset(request.instanceGroupName)) {
    query['InstanceGroupName'] = request.instanceGroupName;
  }
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policyGroupId)) {
    query['PolicyGroupId'] = request.policyGroupId;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAndroidInstanceGroups',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an instance group.
 *
 * @param request DescribeAndroidInstanceGroupsRequest
 * @return DescribeAndroidInstanceGroupsResponse
 */
async function describeAndroidInstanceGroups(request: DescribeAndroidInstanceGroupsRequest): DescribeAndroidInstanceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAndroidInstanceGroupsWithOptions(request, runtime);
}

model DescribeAndroidInstancesRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='The IDs of the instances.'),
  androidInstanceName?: string(name='AndroidInstanceName', description='The name of the instance.', example='name'),
  authorizedUserId?: string(name='AuthorizedUserId'),
  bizRegionId?: string(name='BizRegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/2807298.html) operation to query the regions where Cloud Phone is supported.', example='cn-shanghai'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PostPaid: pay-as-you-go.
*   PrePaid: subscription.', example='PostPaid'),
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-25nt4kk9whjh****'),
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
  instanceGroupName?: string(name='InstanceGroupName', description='The name of the instance group.', example='test'),
  keyPairId?: string(name='KeyPairId', description='The ID of the bound key pair.', example='kp-5hh431emkpuoi****'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 100.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kw9dGL5jves2FS9RLq****'),
  nodeId?: string(name='NodeId', description='The ID of the node.', example='node_id'),
  nodeName?: string(name='NodeName', description='The name of the node.', example='node_name'),
  officeSiteIds?: [ string ](name='OfficeSiteIds'),
  saleMode?: string(name='SaleMode', description='The sales mode.

Valid values:

*   Instance: the standard mode.
*   Node: the node mode.', example='Instance'),
  status?: string(name='Status', description='The state of the instance.

Valid values:

*   BACKUPING: The instance is being backed up.
*   STARTING: The instance is being started.
*   RUNNING: The instance group is available.
*   DELETING: The instance is being deleted.
*   BACKUP_FAILED: The backup operation failed.
*   DELETED: The instance is deleted.
*   FAILED: The instance failed to be created.
*   STOPPED: The instance is stopped.
*   RECOVERING: The instance has an ongoing file recovery task.
*   UNAVAILABLE: The instance has an exception.
*   REBOOTING: The instance is being restarted.
*   RESETTING: The instance is being reset.
*   STOPPING: The instance is being stopped.
*   RECOVER_FAILED: The file recovery task failed.
*   CREATING: The instance is being created.', example='RUNNING'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='key'),
      value?: string(name='Value', description='The value of the tag.', example='value'),
    }
  ](name='Tag', description='The tags of the resources.'),
}

model DescribeAndroidInstancesResponseBody = {
  instanceModel?: [ 
    {
      androidInstanceGroupId?: string(name='AndroidInstanceGroupId', description='The ID of the instance group.', example='ag-ayyhomlal7po****'),
      androidInstanceGroupName?: string(name='AndroidInstanceGroupName', description='The name of the instance group.', example='AndroidInstanceGroupName'),
      androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the instance.', example='acp-8at8h6ejkadjh****'),
      androidInstanceName?: string(name='AndroidInstanceName', description='The name of the instance.', example='name'),
      androidInstanceStatus?: string(name='AndroidInstanceStatus', description='The state of the instance.', example='RUNNING'),
      appInstanceGroupId?: string(name='AppInstanceGroupId', description='The ID of the delivery group.', example='aig-i7yv6tkn7kh8dv****'),
      appInstanceId?: string(name='AppInstanceId', description='The ID of the physical instance.', example='ai-9ey6io0q58rcd****'),
      authorizedUserId?: string(name='AuthorizedUserId', description='The ID of the user to whom the instance is assigned.', example='test'),
      bindUserId?: string(name='BindUserId', description='The ID of the bound user.', example='test'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance.', example='PrePaid'),
      cpu?: string(name='Cpu', description='The number of vCPUs.', example='4'),
      disks?: [ 
        {
          diskSize?: int32(name='DiskSize', description='The disk size. Unit: GB.', example='32'),
          diskType?: string(name='DiskType', description='The type of the disk.', example='SYSTEM'),
        }
      ](name='Disks', description='The disks.'),
      displayConfig?: {
        dpi?: int32(name='Dpi'),
        fps?: int32(name='Fps'),
        lockResolution?: string(name='LockResolution'),
        resolutionHeight?: int32(name='ResolutionHeight'),
        resolutionWidth?: int32(name='ResolutionWidth'),
      }(name='DisplayConfig'),
      errorCode?: string(name='ErrorCode', description='The cause of the instance data backup failure or restoration failure.', example='FilePathNotFound'),
      gmtCreate?: string(name='GmtCreate', description='The time when the instance was created.', example='2023-05-06 10:42:10'),
      gmtExpired?: string(name='GmtExpired', description='The time when the subscription instance group expires.', example='2024-07-15T02:03:33Z'),
      gmtModified?: string(name='GmtModified', description='The time when the instance was modified.', example='2023-05-06 10:42:10'),
      imageId?: string(name='ImageId'),
      imageVersion?: string(name='ImageVersion', description='The version of the image.', example='3.5.3.867'),
      instanceType?: string(name='InstanceType', description='The type of the instance.', example='acp.basic.small'),
      keyPairId?: string(name='KeyPairId', description='The ID of the key pair.', example='kp-5hh431emkpucs****'),
      memory?: int32(name='Memory', description='The memory size.', example='1024'),
      networkInterfaceIp?: string(name='NetworkInterfaceIp', description='The IP address of the ENI.', example='192.168.22.48'),
      networkInterfaceIpv6Address?: string(name='NetworkInterfaceIpv6Address', description='>  This parameter is not publicly available.', example='null'),
      officeSiteId?: string(name='OfficeSiteId', description='The office network ID.', example='cn-shenzhen+dir-211620****'),
      persistentAppInstanceId?: string(name='PersistentAppInstanceId', description='The ID of the persistent session.', example='p-0btrd5zj8epo****'),
      policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-0bszojpu0seql****'),
      publicIpAddress?: string(name='PublicIpAddress', description='The public IP address.', example='10.32.1.41'),
      publicIpv6Address?: string(name='PublicIpv6Address', description='>  This parameter is not publicly available.', example='null'),
      rate?: int32(name='Rate', description='The progress of instance data backup or restoration.', example='100'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      renderingType?: string(name='RenderingType', description='The rendering type.', example='local'),
      sessionStatus?: string(name='SessionStatus', description='The session status.

Valid values:

*   disConnect: The session is disconnected.
*   connect: The session is connected.', example='connect'),
      tags?: [ 
        {
          key?: string(name='Key', description='The key of the tag.', example='key'),
          value?: string(name='Value', description='The value of the tag.', example='value'),
        }
      ](name='Tags', description='The tags.'),
    }
  ](name='InstanceModel', description='The cloud phone instances.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kmma/xxE9WtwL/ADvZ****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F07A1DA1-E1EB-5CCA-8EED-12F85D32****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeAndroidInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAndroidInstancesResponseBody(name='body'),
}

/**
 * @summary Queries cloud phone instances.
 *
 * @param request DescribeAndroidInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAndroidInstancesResponse
 */
async function describeAndroidInstancesWithOptions(request: DescribeAndroidInstancesRequest, runtime: Util.RuntimeOptions): DescribeAndroidInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.androidInstanceName)) {
    query['AndroidInstanceName'] = request.androidInstanceName;
  }
  if (!Util.isUnset(request.authorizedUserId)) {
    query['AuthorizedUserId'] = request.authorizedUserId;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  if (!Util.isUnset(request.instanceGroupIds)) {
    query['InstanceGroupIds'] = request.instanceGroupIds;
  }
  if (!Util.isUnset(request.instanceGroupName)) {
    query['InstanceGroupName'] = request.instanceGroupName;
  }
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.nodeName)) {
    query['NodeName'] = request.nodeName;
  }
  if (!Util.isUnset(request.officeSiteIds)) {
    query['OfficeSiteIds'] = request.officeSiteIds;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAndroidInstances',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries cloud phone instances.
 *
 * @param request DescribeAndroidInstancesRequest
 * @return DescribeAndroidInstancesResponse
 */
async function describeAndroidInstances(request: DescribeAndroidInstancesRequest): DescribeAndroidInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAndroidInstancesWithOptions(request, runtime);
}

model DescribeAppsRequest {
  appIdList?: [ string ](name='AppIdList', description='The IDs of the applications.'),
  appName?: string(name='AppName', description='The name of the application.', example='defaultAppName'),
  appType?: string(name='AppType'),
  bizRegionId?: string(name='BizRegionId', description='Region id.', example='cn-hangzhou'),
  installationStatus?: string(name='InstallationStatus', description='The installation/uninstallation status of the application.

Valid values:

*   INSTALLFAILED: The application failed to be installed.
*   UNINSTALLING: The application is being uninstalled.
*   INSTALLING: The application is being installed.
*   UNINSTALLED: The application is uninstalled.
*   INSTALLED: The application is installed.
*   UNINSTALLFAILED: The application failed to be uninstalled.', example='INSTALLING'),
  MD5?: string(name='MD5', description='The value of MD5.', example='THCIEH73KEK3334'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kU+SQXzm0H9mu/FiSc****'),
  status?: string(name='Status', description='The status of the application.

Valid values:

*   FAILED: The application failed to be created.
*   NORMAL: The application is available.
*   CREATING: The application is being created.', example='NORMAL'),
}

model DescribeAppsResponseBody = {
  data?: [ 
    {
      androidAppVersion?: string(name='AndroidAppVersion', description='The version of the application.', example='1.0.0'),
      apkSize?: string(name='ApkSize', description='Apk size.', example='10244893'),
      appId?: int32(name='AppId', description='The ID of the application.', example='10404'),
      appName?: string(name='AppName', description='The name of the application.', example='testapp'),
      appType?: string(name='AppType'),
      bizRegionId?: string(name='BizRegionId', description='Region id.', example='cn-hangzhou'),
      description?: string(name='Description', description='The description of the application.', example='default description.'),
      gmtCreate?: string(name='GmtCreate', description='The time when the application was created.', example='2022-08-11 17:45:03'),
      gmtModified?: string(name='GmtModified', description='The time when the application was last modified.', example='2022-08-11 17:45:03'),
      iconUrl?: string(name='IconUrl', description='The icon URL of the application.', example='https://test.png'),
      installationStatus?: string(name='InstallationStatus', description='The installation/uninstallation status of the application.

Valid values:

*   INSTALLFAILED: The application failed to be installed.
*   UNINSTALLING: The application is being uninstalled.
*   INSTALLING: The application is being installed.
*   UNINSTALLED: The application is uninstalled.
*   INSTALLED: The application is installed.
*   UNINSTALLFAILED: The application failed to be uninstalled.', example='INSTALLING'),
      instanceGroupList?: [ string ](name='InstanceGroupList', description='The list of instance groups where the application is installed.'),
      MD5?: string(name='MD5', description='The value of MD5.', example='THCIEH73KEK3334'),
      packageName?: string(name='PackageName', description='The name of the application package.', example='cn.rdstar.rdstarandroid'),
      status?: string(name='Status', description='The status of the application.

Valid values:

*   FAILED: The application failed to be created.
*   NORMAL: The application is available.
*   CREATING: The application is being created.', example='NORMAL'),
    }
  ](name='Data', description='The objects that are returned.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uON****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB95E410-FD1D-53C5-9F7D-93CC44D7****'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppsResponseBody(name='body'),
}

/**
 * @summary Queries applications.
 *
 * @param request DescribeAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAppsResponse
 */
async function describeAppsWithOptions(request: DescribeAppsRequest, runtime: Util.RuntimeOptions): DescribeAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appIdList)) {
    query['AppIdList'] = request.appIdList;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appType)) {
    query['AppType'] = request.appType;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.installationStatus)) {
    query['InstallationStatus'] = request.installationStatus;
  }
  if (!Util.isUnset(request.MD5)) {
    query['MD5'] = request.MD5;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApps',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries applications.
 *
 * @param request DescribeAppsRequest
 * @return DescribeAppsResponse
 */
async function describeApps(request: DescribeAppsRequest): DescribeAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsWithOptions(request, runtime);
}

model DescribeBackupFilesRequest {
  androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the instance.', example='acp-34pqe4r0kd9kn****'),
  androidInstanceName?: string(name='AndroidInstanceName', description='The name of the instance. Fuzzy match is supported.', example='acp-34pqe4r0kd9kn****'),
  backupAll?: boolean(name='BackupAll', description='Specifies whether the whole instance is backed up.

Valid values:

*   true
*   false', example='true'),
  backupFileId?: string(name='BackupFileId', description='The ID of the backup file.', example='bf-dxrh5jrv0zpb8****'),
  backupFileName?: string(name='BackupFileName', description='The name of the backup file. Fuzzy match is supported.', example='defaulBackupFile'),
  description?: string(name='Description', description='The description of the backup file. Fuzzy match is supported.', example='default description.'),
  endTime?: string(name='EndTime', description='The end of the period for querying generated backup files.', example='2024-05-20 10:00:00'),
  endUserId?: string(name='EndUserId', description='The owner of the backup file.', example='test1'),
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-fxdx91jsfyiy3****'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uON****'),
  startTime?: string(name='StartTime', description='The beginning of the period for querying generated backup files.', example='2024-05-23 10:00:00'),
  statusList?: [ string ](name='StatusList', description='The status of the backup files.'),
}

model DescribeBackupFilesResponseBody = {
  data?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the instance.', example='acp-34pqe4r0kd9kn****'),
      androidInstanceName?: string(name='AndroidInstanceName', description='The name of the instance.', example='defaultInstanceName'),
      backupAll?: boolean(name='BackupAll', description='Indicates whether the whole instance is backed up.', example='true'),
      backupFileId?: string(name='BackupFileId', description='The ID of the backup file.', example='bf-b0qbg3pbpjkn7****'),
      backupFileName?: string(name='BackupFileName', description='The name of the backup file.', example='a-58ftsoo90p0qa****.ab'),
      backupFilePath?: string(name='BackupFilePath', description='The directory in which the backup file is stored.', example='oss://cloudphone-saved-bucket-cn-shanghai/backup/aic-58ftsoo90p0qa****.ab'),
      description?: string(name='Description', description='The description of the backup file.', example='This is default description.'),
      endUserId?: string(name='EndUserId', description='The owner of the backup file.', example='test'),
      fileSize?: long(name='FileSize', description='The total size of the source files.', example='10227168'),
      gmtCreated?: string(name='GmtCreated', description='The time when the backup file was created.', example='2024-05-15 17:33:59'),
      gmtModified?: string(name='GmtModified', description='The time when the backup file was last updated.', example='2024-05-15 17:33:59'),
      instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-58ftsoo90p0qi****'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      sourceAppInfoList?: [ string ](name='SourceAppInfoList', description='The names of the application packages that are backed up.'),
      sourceFilePathList?: [ string ](name='SourceFilePathList', description='The directories of the source files.'),
      status?: string(name='Status', description='The status of the backup file.

Valid values:

*   AVAILABLE
*   RECOVERING', example='AVAILABLE'),
      taskId?: string(name='TaskId', description='The task ID.', example='t-bp67acfmxazb4p****'),
      uploadEndpoint?: string(name='UploadEndpoint', description='The endpoint of the OSS bucket that stores the backup file.', example='oss-cn-hangzhou.aliyuncs.com'),
      uploadType?: string(name='UploadType', description='The type of the backup.

Valid values:

*   OSS: backup files are stored in OSS buckets. .', example='OSS'),
    }
  ](name='Data', description='The backup files that are returned.'),
  maxResults?: string(name='MaxResults', description='The total number of entries returned.', example='10'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uON****'),
  requestId?: string(name='RequestId', description='The ID of the request. If the request fails, provide this ID to technical support to assist in diagnosing the issue.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='91'),
}

model DescribeBackupFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupFilesResponseBody(name='body'),
}

/**
 * @summary Queries backup files.
 *
 * @description Currently, this operation allows you to query only backup files generated by cloud phones that are stored in Object Storage Service (OSS) buckets.
 *
 * @param request DescribeBackupFilesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupFilesResponse
 */
async function describeBackupFilesWithOptions(request: DescribeBackupFilesRequest, runtime: Util.RuntimeOptions): DescribeBackupFilesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceId)) {
    query['AndroidInstanceId'] = request.androidInstanceId;
  }
  if (!Util.isUnset(request.androidInstanceName)) {
    query['AndroidInstanceName'] = request.androidInstanceName;
  }
  if (!Util.isUnset(request.backupAll)) {
    query['BackupAll'] = request.backupAll;
  }
  if (!Util.isUnset(request.backupFileId)) {
    query['BackupFileId'] = request.backupFileId;
  }
  if (!Util.isUnset(request.backupFileName)) {
    query['BackupFileName'] = request.backupFileName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.endUserId)) {
    query['EndUserId'] = request.endUserId;
  }
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statusList)) {
    query['StatusList'] = request.statusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupFiles',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries backup files.
 *
 * @description Currently, this operation allows you to query only backup files generated by cloud phones that are stored in Object Storage Service (OSS) buckets.
 *
 * @param request DescribeBackupFilesRequest
 * @return DescribeBackupFilesResponse
 */
async function describeBackupFiles(request: DescribeBackupFilesRequest): DescribeBackupFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupFilesWithOptions(request, runtime);
}

model DescribeCloudPhoneNodesRequest {
  bizRegionId?: string(name='BizRegionId', description='The region ID.', example='cn-hangzhou'),
  chargeType?: string(name='ChargeType', description='The billing method. Only the subscription billing method is supported.', example='PrePaid'),
  maxResults?: string(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If a query doesn\\\\"t return all results, the response includes a NextToken value for pagination. You must specify the token that is obtained from the previous query as the value of NextToken.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uONHqPtDLM2U8s****'),
  nodeIds?: [ string ](name='NodeIds', description='The matrix IDs.'),
  nodeName?: string(name='NodeName', description='The matrix name.', example='node_name'),
  serverType?: string(name='ServerType', description='The matrix specification.

Valid values:

*   cpm.gn6.gx1', example='cpm.gn6.gx1'),
  status?: string(name='Status', description='The matrix status.

Valid values:

*   FAILED: The matrix failed to be created.
*   RUNNING: The matrix is available.
*   DELETING: The matrix is being deleted.
*   NODE_READY: The matrix is ready, and cloud phone instances are being created.
*   DELETED: The matrix is deleted.
*   CREATING: The matrix is being created.', example='CREATING'),
}

model DescribeCloudPhoneNodesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   ****', example='AAAAAV3MpHK1AP0pfERHZN5pu6kU+SQXzm0H9mu/FiSc****'),
  nodeModel?: [ 
    {
      chargeType?: string(name='ChargeType', description='The billing method.', example='PrePaid'),
      cpu?: string(name='Cpu', description='The number of CPU cores.', example='2'),
      gmtCreate?: string(name='GmtCreate', description='The creation time.', example='2024-11-13 02:03:14'),
      gmtExpired?: string(name='GmtExpired', description='The expiration time of the subscription matrix.', example='2025-03-09 02:00:34'),
      gmtModified?: string(name='GmtModified', description='The last modification time.', example='2025-02-13 02:03:14'),
      instanceType?: string(name='InstanceType'),
      memory?: int32(name='Memory', description='The memory size. Unit: GB.', example='32'),
      networkId?: string(name='NetworkId', description='The network ID.', example='cn-hangzhou+dir-5mwr9azebliva****'),
      nodeId?: string(name='NodeId', description='The matrix ID.', example='cpn-ehs0yoedq8ntm****'),
      nodeName?: string(name='NodeName', description='The matrix name.', example='node_name'),
      phoneCount?: int32(name='PhoneCount', description='The number of cloud phone instances per matrix.', example='25'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution. Unit: pixel.', example='1280'),
      resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution. Unit: pixel.', example='720'),
      serverType?: string(name='ServerType', description='The matrix specification.', example='cpm.gn6.gx1'),
      shareDataVolume?: int32(name='ShareDataVolume', description='The size of the shared storage. Unit: GiB.', example='100'),
      status?: string(name='Status', description='The matrix status.', example='RUNNING'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-2zeekryyc1q3sm72l****'),
    }
  ](name='NodeModel', description='The matrixes.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F07A1DA1-E1EB-5CCA-8EED-12F85D32****'),
  totalCount?: int32(name='TotalCount', description='The total number of cloud phone instances.', example='31'),
}

model DescribeCloudPhoneNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCloudPhoneNodesResponseBody(name='body'),
}

/**
 * @summary Queries the details of a cloud phone matrix.
 *
 * @param request DescribeCloudPhoneNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCloudPhoneNodesResponse
 */
async function describeCloudPhoneNodesWithOptions(request: DescribeCloudPhoneNodesRequest, runtime: Util.RuntimeOptions): DescribeCloudPhoneNodesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.nodeIds)) {
    query['NodeIds'] = request.nodeIds;
  }
  if (!Util.isUnset(request.nodeName)) {
    query['NodeName'] = request.nodeName;
  }
  if (!Util.isUnset(request.serverType)) {
    query['ServerType'] = request.serverType;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCloudPhoneNodes',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a cloud phone matrix.
 *
 * @param request DescribeCloudPhoneNodesRequest
 * @return DescribeCloudPhoneNodesResponse
 */
async function describeCloudPhoneNodes(request: DescribeCloudPhoneNodesRequest): DescribeCloudPhoneNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCloudPhoneNodesWithOptions(request, runtime);
}

model DescribeImageListRequest {
  imageId?: string(name='ImageId', description='The ID of the image.', example='imgc-075cllfeuazh0****'),
  imageName?: string(name='ImageName', description='The name of the image.', example='Android 12 image'),
  imagePackageType?: string(name='ImagePackageType', description='Image package type.', example='VM'),
  imageType?: string(name='ImageType', description='The type of the image.

Valid values:

*   User: custom images.
*   System: system images.

This parameter is required.', example='System'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20', nullable=true),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kw9dGL5jves2FS9RLq****'),
  status?: string(name='Status', description='The state of the image.

Valid values:

*   AVAILABLE: The image is available.
*   DELETE: The image is deleted.
*   INIT: The image is being initialized.
*   CREATE_FAILED: The image failed to be created.
*   CREATING: The image is being created.', example='AVAILABLE'),
}

model DescribeImageListResponseBody = {
  data?: [ 
    {
      aliUid?: long(name='AliUid', description='The ID of the Alibaba Cloud account.', example='117819727354****'),
      description?: string(name='Description', description='The description of the image.', example='description'),
      gmtCreate?: string(name='GmtCreate', description='The time when the image was created.', example='2024-02-01 10:56:36'),
      gmtModified?: string(name='GmtModified', description='The time when the image was last modified.', example='2024-02-01 10:56:36'),
      imageId?: string(name='ImageId', description='The ID of the image.', example='imgc-075cllfeuazh****'),
      imageName?: string(name='ImageName', description='The name of the image.', example='IMAGE'),
      imageRegionDistributeMap?: map[string]DataImageRegionDistributeMapValue(name='ImageRegionDistributeMap', description='The region where the image is distributed. The key is the region and the value is the distribution information.'),
      imageRegionList?: [ string ](name='ImageRegionList', description='The list of regions.'),
      imageType?: string(name='ImageType', description='The type of the image.

Valid values:

*   User: custom images.
*   System: system images.', example='System'),
      imageVersion?: string(name='ImageVersion'),
      language?: string(name='Language', description='The language of the image.', example='zh'),
      releaseTime?: string(name='ReleaseTime', description='The time when the image was published.', example='2024-07-25 10:06:45'),
      renderingType?: string(name='RenderingType', description='The rendering type.

Valid values:

*   GPURemote
*   CPU
*   GPULocal', example='CPU'),
      status?: string(name='Status', description='The state of the image.

Valid values:

*   AVAILABLE: The image is available.
*   DELETE: The image is deleted.
*   INIT: The image is being initialized.
*   CREATE_FAILED: The image failed to be created.
*   CREATING: The image is being created.', example='AVAILABLE'),
      systemType?: string(name='SystemType', description='The OS type of the image.', example='Android 12'),
    }
  ](name='Data', description='The images.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uON****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='620740FF-492F-5956-B1BA-361E966C0269'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='30'),
}

model DescribeImageListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeImageListResponseBody(name='body'),
}

/**
 * @summary Queries images.
 *
 * @param request DescribeImageListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeImageListResponse
 */
async function describeImageListWithOptions(request: DescribeImageListRequest, runtime: Util.RuntimeOptions): DescribeImageListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.imagePackageType)) {
    query['ImagePackageType'] = request.imagePackageType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageId)) {
    body['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.imageName)) {
    body['ImageName'] = request.imageName;
  }
  if (!Util.isUnset(request.imageType)) {
    body['ImageType'] = request.imageType;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeImageList',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries images.
 *
 * @param request DescribeImageListRequest
 * @return DescribeImageListResponse
 */
async function describeImageList(request: DescribeImageListRequest): DescribeImageListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeImageListWithOptions(request, runtime);
}

model DescribeInvocationsRequest {
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.

This parameter is required.'),
  invocationId?: string(name='InvocationId', description='The ID of the execution. You can retrieve the output of a command once by using either the execution ID or the cloud phone instance ID.

This parameter is required.', example='t-4e98eeb5****'),
}

model DescribeInvocationsResponseBody = {
  data?: [ 
    {
      finishTime?: string(name='FinishTime', description='The end time of the command execution.', example='2022-08-11 17:45:03'),
      instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance on which the command is executed.', example='acp-uto81vfd8t8z****'),
      invocationId?: string(name='InvocationId', description='The ID of the execution.', example='t-15775dc8****'),
      invocationStatus?: string(name='InvocationStatus', description='The execution state of the command.

Valid values:

*   Failed: The execution of the command failed.
*   Timeout: The execution of the command timed out.
*   Running: The command is being executed.
*   Success: The execution of the command is successful.
*   Pending: The command is waiting to be executed.', example='RUNNING'),
      output?: string(name='Output', description='The output of the command execution.', example='success'),
      startTime?: string(name='StartTime', description='The start time of the command execution.', example='2022-08-11 17:45:03'),
    }
  ](name='Data', description='The objects that are returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='440D7342-5E7C-B2DB-D0B4EAC2BDF1****'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeInvocationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInvocationsResponseBody(name='body'),
}

/**
 * @summary Queries the execution results of commands.
 *
 * @param request DescribeInvocationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInvocationsResponse
 */
async function describeInvocationsWithOptions(request: DescribeInvocationsRequest, runtime: Util.RuntimeOptions): DescribeInvocationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.invocationId)) {
    query['InvocationId'] = request.invocationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInvocations',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution results of commands.
 *
 * @param request DescribeInvocationsRequest
 * @return DescribeInvocationsResponse
 */
async function describeInvocations(request: DescribeInvocationsRequest): DescribeInvocationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInvocationsWithOptions(request, runtime);
}

model DescribeKeyPairsRequest {
  keyPairIds?: [ string ](name='KeyPairIds', description='The IDs of the ADB key pairs.'),
  keyPairName?: string(name='KeyPairName', description='The name of the ADB key pair.', example='testKeyPairName'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='AAAAAYRHtOLVQzCYj17y+OP7LZQBUVVbi0GTu8g5****'),
}

model DescribeKeyPairsResponseBody = {
  data?: [ 
    {
      gmtCreated?: string(name='GmtCreated', description='The time when the ADB key pair was created.', example='2022-10-11T08:53:32Z'),
      keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.', example='kp-6v2q33ae4tw3a****'),
      keyPairName?: string(name='KeyPairName', description='The name of the ADB key pair.', example='testKeyPairName'),
    }
  ](name='Data', description='The objects that are returned.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='FFbc8N4E1iOlcSxC+8boa0HHH2LKWbggYUinyrZWvtS1oTrMYCg1HuMLGuftj0****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='565FB06A-AE04-5AD0-8A32-5BA92CA5****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeKeyPairsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKeyPairsResponseBody(name='body'),
}

/**
 * @summary Queries one or more key pairs.
 *
 * @param request DescribeKeyPairsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKeyPairsResponse
 */
async function describeKeyPairsWithOptions(request: DescribeKeyPairsRequest, runtime: Util.RuntimeOptions): DescribeKeyPairsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyPairIds)) {
    query['KeyPairIds'] = request.keyPairIds;
  }
  if (!Util.isUnset(request.keyPairName)) {
    query['KeyPairName'] = request.keyPairName;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKeyPairs',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries one or more key pairs.
 *
 * @param request DescribeKeyPairsRequest
 * @return DescribeKeyPairsResponse
 */
async function describeKeyPairs(request: DescribeKeyPairsRequest): DescribeKeyPairsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKeyPairsWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The display language of the console. Valid values:

*   cn: Simplified Chinese
*   en: English', example='en'),
  saleMode?: string(name='SaleMode', description='The sales mode.

Valid values:

*   Instance: the instance group mode. [Default]
*   Node: the matrix mode. [Whitelist required]', example='Instance'),
}

model DescribeRegionsResponseBody = {
  regionModels?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      regionName?: string(name='RegionName', description='The region name.', example='China (Hangzhou)'),
    }
  ](name='RegionModels', description='Available regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A87B3769-0D05-5383-B236-5798B455****'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Query available regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query available regions.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeSpecRequest {
  bizRegionId?: string(name='BizRegionId', example='cn-hangzhou'),
  matrixSpec?: string(name='MatrixSpec', description='The matrix specification.

Valid values:

*   cpm.gn6.gx1', example='cpm.gn6.gx1'),
  maxResults?: int32(name='MaxResults', description='The maximum number of items to return per page in a paginated query. The value range is 1 to 100, with a default value of 100.', example='20'),
  nextToken?: string(name='NextToken', description='Indicates the starting position for reading. If left empty, it starts from the beginning.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uONHqPtDLM2U8s****'),
  saleMode?: string(name='SaleMode', description='The purchase mode of cloud mobile phones.

Valid values:

*   Instance (default): the instance group mode.
*   Node: the matrix mode [whitelisted].', example='Instance'),
  specIds?: [ string ](name='SpecIds', description='List of specification IDs.'),
  specStatus?: string(name='SpecStatus', description='Specification status.', example='Available'),
  specType?: string(name='SpecType', description='Specification type.', example='ARM'),
}

model DescribeSpecResponseBody = {
  nextToken?: string(name='NextToken', description='Indicates the current read position returned by this call. An empty value means that all data has been read.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kw9dGL5jves2FS9RLq****'),
  requestId?: string(name='RequestId', description='Request ID.', example='D9888DAD-331E-5FBC-B5A0-F2445115****'),
  specInfoModel?: [ 
    {
      core?: int32(name='Core', description='Number of CPU cores.', example='8'),
      maxPhoneCount?: string(name='MaxPhoneCount', description='The maximum number of cloud phone instances.', example='40'),
      memory?: int32(name='Memory', description='Memory size.', example='16'),
      minPhoneCount?: string(name='MinPhoneCount', description='The minimum number of cloud phone instances.', example='4'),
      phoneCount?: string(name='PhoneCount', example='2'),
      resolution?: string(name='Resolution', example='1920*1080'),
      specId?: string(name='SpecId', description='Specification ID.', example='acp.basic.small'),
      specStatus?: string(name='SpecStatus', description='Specification status.', example='Available'),
      specType?: string(name='SpecType', description='Specification type.', example='ARM'),
      systemDiskSize?: int32(name='SystemDiskSize', description='System disk size, in GB.', example='32'),
    }
  ](name='SpecInfoModel', description='The specifications.'),
  totalCount?: int32(name='TotalCount', description='Total number of items.', example='4'),
}

model DescribeSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSpecResponseBody(name='body'),
}

/**
 * @summary Query available specifications.
 *
 * @param request DescribeSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSpecResponse
 */
async function describeSpecWithOptions(request: DescribeSpecRequest, runtime: Util.RuntimeOptions): DescribeSpecResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.matrixSpec)) {
    query['MatrixSpec'] = request.matrixSpec;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  if (!Util.isUnset(request.specIds)) {
    query['SpecIds'] = request.specIds;
  }
  if (!Util.isUnset(request.specStatus)) {
    query['SpecStatus'] = request.specStatus;
  }
  if (!Util.isUnset(request.specType)) {
    query['SpecType'] = request.specType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSpec',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query available specifications.
 *
 * @param request DescribeSpecRequest
 * @return DescribeSpecResponse
 */
async function describeSpec(request: DescribeSpecRequest): DescribeSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSpecWithOptions(request, runtime);
}

model DescribeTasksRequest {
  instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance.', example='acp-2zecay9ponatdc4m****'),
  instanceName?: string(name='InstanceName', description='The name of the cloud phone instance.', example='defaultInstanceName'),
  invokeId?: string(name='InvokeId', description='The ID of the command execution. You can set the value to the last returned request ID.', example='B8ED2BA9-0C6A-5643-818F-B5D60A64****'),
  level?: int32(name='Level', description='The level of the task. A value of 1 specifies a batch task. A value of 2 specifies an instance-level task.', example='1'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='FFbc8N4E1iOlcSxC+8boa0HHH2LKWbggYUinyrZWvtS1oTrMYCg1HuMLGuftj0****'),
  param?: string(name='Param', description='The extension field.', example='param'),
  parentTaskId?: string(name='ParentTaskId', description='The ID of the parent task.', example='t-iaej5dkbnmivx****'),
  resourceIds?: [ string ](name='ResourceIds', description='The IDs of the resources.'),
  taskIds?: [ string ](name='TaskIds', description='The IDs of the tasks.'),
  taskStatus?: string(name='TaskStatus', description='The state of the task.

Valid values:

*   PartFinished: The task is partially successful.
*   Finished: The task is completed.
*   Failed: The task failed.
*   Skipped: The task is skipped.
*   Processing: The task is running.
*   Waiting: The task is in queue.', example='Processing'),
  taskStatuses?: [ string ](name='TaskStatuses', description='The status of the tasks.'),
  taskType?: string(name='TaskType', description='The type of the task.

Valid values:

*   BackupFile: backs up files.
*   StopInstance: stops cloud phone instances.
*   RebootInstance: restarts cloud phone instances.
*   StartApp: starts apps.
*   SendFile: uploads files.
*   RunCommand: sends remote command.
*   RestartApp: restarts apps.
*   ResetInstance: resets cloud phone instances.
*   RecoverFile: recovers files.
*   UninstallApp: uninstalls apps.
*   StopApp: stops apps.
*   Screenshot: takes screenshots.
*   InstallApp: installs apps.
*   FetchFile: downloads files.
*   UpdateGroupImage: replaces images.
*   StartInstance: starts instances.', example='StartInstance'),
  taskTypes?: [ string ](name='TaskTypes', description='The types of the tasks.'),
}

model DescribeTasksResponseBody = {
  data?: [ 
    {
      errorCode?: string(name='ErrorCode', description='The error code.', example='SendFileFailed'),
      errorMsg?: string(name='ErrorMsg', description='The error message.', example='connect error.'),
      failedChildCount?: int32(name='FailedChildCount', description='The total number of failed subtasks.', example='2'),
      finishTime?: string(name='FinishTime', description='The end time of the task.', example='2022-10-11T08:53:32Z'),
      instanceId?: string(name='InstanceId', description='The ID of the cloud phone instance.', example='acp-uto81vfd8t8z****'),
      instanceName?: string(name='InstanceName', description='The name of the cloud phone instance.', example='defaultInstanceName'),
      instanceStatus?: string(name='InstanceStatus', description='The state of the cloud phone instance.', example='RUNNING'),
      invokeId?: string(name='InvokeId', description='The ID of the command execution.', example='B8ED2BA9-0C6A-5643-818F-B5D60A64****'),
      level?: int32(name='Level', description='The level of the task.', example='1'),
      operator?: string(name='Operator', description='The operator.', example='test'),
      param?: string(name='Param', description='The parameters of the task.', example='param'),
      parentTaskId?: string(name='ParentTaskId', description='The ID of the parent task.', example='t-41oan3tza16vs****'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='acp-25nt4kk9whhok****'),
      result?: string(name='Result', description='The execution result of the task.', example='{\\\\"Success\\\\": True}'),
      runningChildCount?: int32(name='RunningChildCount', description='The total number of the subtasks that are running.', example='0'),
      startTime?: string(name='StartTime', description='The start time of the task.', example='2022-10-11T08:53:32Z'),
      successChildCount?: int32(name='SuccessChildCount', description='The total number of successfully executed subtasks.', example='98'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='t-bp67acfmxazb4p****'),
      taskStatus?: string(name='TaskStatus', description='The state of the task.', example='Processing'),
      taskType?: string(name='TaskType', description='The type of the task.', example='StartInstance'),
      totalChildCount?: int32(name='TotalChildCount', description='The total number of subtasks of the current batch task.', example='100'),
    }
  ](name='Data', description='The objects that are returned.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kU+SQXzm0H9mu/FiSc****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B8ED2BA9-0C6A-5643-818F-B5D60A64****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTasksResponseBody(name='body'),
}

/**
 * @summary Queries tasks created for a cloud phone instance.
 *
 * @description *   You can call the DescribeTasks operation to query the tasks created for one or more cloud phone instances.
 * *   The system currently supports various tasks, including starting, stopping, restarting, and resetting cloud phone instances; backing up and restoring data; installing apps; and executing remote commands.
 * *   You can use the Level field to specify the type of task. If Level is set to 1, it represents a batch task. If Level is set to 2, it represents an instance-level task.
 * **Example**
 * Assume you restart two cloud phone instances with the instance IDs acp-25nt4kk9whhok\\*\\*\\*\\* and acp-j2taq887orj8l\\*\\*\\*\\*, and the returned request ID is B8ED2BA9-0C6A-5643-818F-B5D60A64\\*\\*\\*\\*. If you want to check the operation outcomes of the two cloud phone instances, you can call the DescribeTasks operation. You need to set the InvokeId request parameter to B8ED2BA9-0C6A-5643-818F-B5D60A64\\*\\*\\*\\*. If you only want to check the cloud phone instance with the ID acp-25nt4kk9whhok\\*\\*\\*\\*, you must set the ParentTaskId request parameter to the ID of the batch task and the AndroidInstanceId request parameter to acp-25nt4kk9whhok\\*\\*\\*\\* when calling the DescribeTasks operation.
 *
 * @param request DescribeTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTasksResponse
 */
async function describeTasksWithOptions(request: DescribeTasksRequest, runtime: Util.RuntimeOptions): DescribeTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.invokeId)) {
    query['InvokeId'] = request.invokeId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.param)) {
    query['Param'] = request.param;
  }
  if (!Util.isUnset(request.parentTaskId)) {
    query['ParentTaskId'] = request.parentTaskId;
  }
  if (!Util.isUnset(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  if (!Util.isUnset(request.taskStatus)) {
    query['TaskStatus'] = request.taskStatus;
  }
  if (!Util.isUnset(request.taskStatuses)) {
    query['TaskStatuses'] = request.taskStatuses;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.taskTypes)) {
    query['TaskTypes'] = request.taskTypes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTasks',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries tasks created for a cloud phone instance.
 *
 * @description *   You can call the DescribeTasks operation to query the tasks created for one or more cloud phone instances.
 * *   The system currently supports various tasks, including starting, stopping, restarting, and resetting cloud phone instances; backing up and restoring data; installing apps; and executing remote commands.
 * *   You can use the Level field to specify the type of task. If Level is set to 1, it represents a batch task. If Level is set to 2, it represents an instance-level task.
 * **Example**
 * Assume you restart two cloud phone instances with the instance IDs acp-25nt4kk9whhok\\*\\*\\*\\* and acp-j2taq887orj8l\\*\\*\\*\\*, and the returned request ID is B8ED2BA9-0C6A-5643-818F-B5D60A64\\*\\*\\*\\*. If you want to check the operation outcomes of the two cloud phone instances, you can call the DescribeTasks operation. You need to set the InvokeId request parameter to B8ED2BA9-0C6A-5643-818F-B5D60A64\\*\\*\\*\\*. If you only want to check the cloud phone instance with the ID acp-25nt4kk9whhok\\*\\*\\*\\*, you must set the ParentTaskId request parameter to the ID of the batch task and the AndroidInstanceId request parameter to acp-25nt4kk9whhok\\*\\*\\*\\* when calling the DescribeTasks operation.
 *
 * @param request DescribeTasksRequest
 * @return DescribeTasksResponse
 */
async function describeTasks(request: DescribeTasksRequest): DescribeTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTasksWithOptions(request, runtime);
}

model DetachKeyPairRequest {
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.'),
  keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.

This parameter is required.', example='kp-6v2q33ae4tw3a****'),
}

model DetachKeyPairResponseBody = {
  data?: {
    detachedInstanceIds?: [ string ](name='DetachedInstanceIds', description='The IDs of the cloud phone instances from which the ADB key pair is successfully detached.'),
    failCount?: int32(name='FailCount', description='The number of the cloud phone instances from which the ADB key pair failed to be detached.', example='0'),
    keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.', example='kp-6v2q33ae4tw3a****'),
    totalCount?: int32(name='TotalCount', description='The total number of the cloud phone instances.', example='10'),
  }(name='Data', description='The object that is returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model DetachKeyPairResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachKeyPairResponseBody(name='body'),
}

/**
 * @summary Detaches an Android Debug Bridge (ADB) key pair from one or more cloud phone instances.
 *
 * @description *   After you detach an ADB key pair from a cloud phone instance, the ADB connection will fail. This occurs because the system can no longer authenticate using a valid ADB public key, leading to authentication errors.
 *
 * @param request DetachKeyPairRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachKeyPairResponse
 */
async function detachKeyPairWithOptions(request: DetachKeyPairRequest, runtime: Util.RuntimeOptions): DetachKeyPairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachKeyPair',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Detaches an Android Debug Bridge (ADB) key pair from one or more cloud phone instances.
 *
 * @description *   After you detach an ADB key pair from a cloud phone instance, the ADB connection will fail. This occurs because the system can no longer authenticate using a valid ADB public key, leading to authentication errors.
 *
 * @param request DetachKeyPairRequest
 * @return DetachKeyPairResponse
 */
async function detachKeyPair(request: DetachKeyPairRequest): DetachKeyPairResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachKeyPairWithOptions(request, runtime);
}

model DisconnectAndroidInstanceRequest {
  instanceIds?: [ string ](name='InstanceIds', description='This parameter is required.'),
}

model DisconnectAndroidInstanceResponseBody = {
  requestId?: string(name='RequestId', example='E5138F7E-46B5-526A-8C99-82DEAE6B****'),
}

model DisconnectAndroidInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisconnectAndroidInstanceResponseBody(name='body'),
}

/**
 * @summary 实例断开连接
 *
 * @param request DisconnectAndroidInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisconnectAndroidInstanceResponse
 */
async function disconnectAndroidInstanceWithOptions(request: DisconnectAndroidInstanceRequest, runtime: Util.RuntimeOptions): DisconnectAndroidInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisconnectAndroidInstance',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实例断开连接
 *
 * @param request DisconnectAndroidInstanceRequest
 * @return DisconnectAndroidInstanceResponse
 */
async function disconnectAndroidInstance(request: DisconnectAndroidInstanceRequest): DisconnectAndroidInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return disconnectAndroidInstanceWithOptions(request, runtime);
}

model DistributeImageRequest {
  distributeRegionList?: [ string ](name='DistributeRegionList', description='The regions to which you want to distribute an image.

This parameter is required.'),
  imageId?: string(name='ImageId', description='The ID of the image that you want to distribute.

This parameter is required.', example='imgc-075cllfeuazh0****'),
}

model DistributeImageResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='440D7342-5FC2-5E7C-B2DB-D0B4EAC2BDF1'),
}

model DistributeImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DistributeImageResponseBody(name='body'),
}

/**
 * @summary Distributes an image.
 *
 * @description After you distribute an image in supported regions, the distribution cannot be canceled.
 *
 * @param request DistributeImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DistributeImageResponse
 */
async function distributeImageWithOptions(request: DistributeImageRequest, runtime: Util.RuntimeOptions): DistributeImageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.distributeRegionList)) {
    body['DistributeRegionList'] = request.distributeRegionList;
  }
  if (!Util.isUnset(request.imageId)) {
    body['ImageId'] = request.imageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DistributeImage',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Distributes an image.
 *
 * @description After you distribute an image in supported regions, the distribution cannot be canceled.
 *
 * @param request DistributeImageRequest
 * @return DistributeImageResponse
 */
async function distributeImage(request: DistributeImageRequest): DistributeImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return distributeImageWithOptions(request, runtime);
}

model DowngradeAndroidInstanceGroupRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='The IDs of the cloud phone instances that you want to delete.'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature. Default value: false.

Valid values:

*   true: enables the auto-payment feature. Ensure your account has sufficient balance to use this feature.
*   false: disables the auto-payment feature. This requires manual payment each time you place an order.', example='true'),
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.

This parameter is required.', example='ag-cuv4scs4obxhs****'),
}

model DowngradeAndroidInstanceGroupResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='22326560487****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3AF82CE1-2801-52CE-BF64-B491DD7C****'),
}

model DowngradeAndroidInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DowngradeAndroidInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Downgrades an instance group. Currently, this operation allows you to only delete specific cloud phone instances from an instance group.
 *
 * @description This operation only allows you to scale down an instance group.
 *
 * @param request DowngradeAndroidInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DowngradeAndroidInstanceGroupResponse
 */
async function downgradeAndroidInstanceGroupWithOptions(request: DowngradeAndroidInstanceGroupRequest, runtime: Util.RuntimeOptions): DowngradeAndroidInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DowngradeAndroidInstanceGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Downgrades an instance group. Currently, this operation allows you to only delete specific cloud phone instances from an instance group.
 *
 * @description This operation only allows you to scale down an instance group.
 *
 * @param request DowngradeAndroidInstanceGroupRequest
 * @return DowngradeAndroidInstanceGroupResponse
 */
async function downgradeAndroidInstanceGroup(request: DowngradeAndroidInstanceGroupRequest): DowngradeAndroidInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return downgradeAndroidInstanceGroupWithOptions(request, runtime);
}

model EndCoordinationRequest {
  coordinatorUserId?: string(name='CoordinatorUserId', example='lina'),
  instanceId?: string(name='InstanceId', example='acp-2zecay9ponatdc4m****'),
  ownerUserId?: string(name='OwnerUserId', example='xiaoming'),
}

model EndCoordinationResponseBody = {
  requestId?: string(name='RequestId', example='5C5CEF0A-D6E1-58D3-8750-67DB4F82****'),
}

model EndCoordinationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EndCoordinationResponseBody(name='body'),
}

/**
 * @summary 结束协同
 *
 * @param request EndCoordinationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EndCoordinationResponse
 */
async function endCoordinationWithOptions(request: EndCoordinationRequest, runtime: Util.RuntimeOptions): EndCoordinationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.coordinatorUserId)) {
    query['CoordinatorUserId'] = request.coordinatorUserId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerUserId)) {
    query['OwnerUserId'] = request.ownerUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EndCoordination',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 结束协同
 *
 * @param request EndCoordinationRequest
 * @return EndCoordinationResponse
 */
async function endCoordination(request: EndCoordinationRequest): EndCoordinationResponse {
  var runtime = new Util.RuntimeOptions{};
  return endCoordinationWithOptions(request, runtime);
}

model ExpandDataVolumeRequest {
  autoPay?: boolean(name='AutoPay', example='true'),
  bizRegionId?: string(name='BizRegionId', example='cn-hangzhou'),
  nodeIds?: [ string ](name='NodeIds'),
  shareDataVolume?: int32(name='ShareDataVolume', example='100'),
}

model ExpandDataVolumeResponseBody = {
  orderId?: string(name='OrderId', example='22326560487****'),
  requestId?: string(name='RequestId', example='5C5CEF0A-D6E1-58D3-8750-67DB4F82****'),
}

model ExpandDataVolumeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExpandDataVolumeResponseBody(name='body'),
}

/**
 * @summary 存储扩容
 *
 * @param request ExpandDataVolumeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExpandDataVolumeResponse
 */
async function expandDataVolumeWithOptions(request: ExpandDataVolumeRequest, runtime: Util.RuntimeOptions): ExpandDataVolumeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.bizRegionId)) {
    query['BizRegionId'] = request.bizRegionId;
  }
  if (!Util.isUnset(request.nodeIds)) {
    query['NodeIds'] = request.nodeIds;
  }
  if (!Util.isUnset(request.shareDataVolume)) {
    query['ShareDataVolume'] = request.shareDataVolume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExpandDataVolume',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 存储扩容
 *
 * @param request ExpandDataVolumeRequest
 * @return ExpandDataVolumeResponse
 */
async function expandDataVolume(request: ExpandDataVolumeRequest): ExpandDataVolumeResponse {
  var runtime = new Util.RuntimeOptions{};
  return expandDataVolumeWithOptions(request, runtime);
}

model FetchFileRequest {
  androidInstanceIdList?: [ string ](name='AndroidInstanceIdList', description='The IDs of the cloud phone instances.

This parameter is required.'),
  sourceFilePath?: string(name='SourceFilePath', description='The path to the file that you want to pull from the cloud phone instance.

This parameter is required.', example='/data/a.txt'),
  uploadEndpoint?: string(name='UploadEndpoint', description='The endpoint of the OSS bucket in which you want to store the pulled file.

>  Set the value to an internal endpoint when the cloud phone instance and the OSS bucket are in the same region to improve upload speed without incurring public traffic fees. Sample endpoint: `oss-cn-hangzhou-internal.aliyuncs.com`. For more information, see [OSS regions and endpoints](https://help.aliyun.com/document_detail/31837.html).

This parameter is required.', example='oss-cn-hangzhou.aliyuncs.com'),
  uploadType?: string(name='UploadType', description='The type of the storage service.

>  Currently, only OSS is supported.

This parameter is required.', example='OSS'),
  uploadUrl?: string(name='UploadUrl', description='The OSS URL of the pulled file.

>  The OSS bucket name must start with "cloudphone-saved-bucket-", for example, "cloudphone-saved-bucket-example". You must also create an OSS directory to store the backup data. Set the value for UploadUrl in this format: oss://\\\\<BucketName>/\\\\<OSSDirectoryName>.

This parameter is required.'),
}

model FetchFileResponseBody = {
  data?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId'),
      taskId?: string(name='TaskId'),
    }
  ](name='Data', description='The objects that are returned.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  requestId?: string(name='RequestId', description='The ID of the request. If the request fails, share this ID with technical support to help diagnose the issue.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  taskId?: string(name='TaskId', description='The ID of the batch task.', example='t-ehs0yoedj0xe9****'),
}

model FetchFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FetchFileResponseBody(name='body'),
}

/**
 * @summary Pulls a file from a cloud phone instance and stores it in Object Storage Service (OSS).
 *
 * @description Currently, this operation allows you to retrieve files or folders from cloud phone instances and save them directly to OSS.
 *
 * @param request FetchFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FetchFileResponse
 */
async function fetchFileWithOptions(request: FetchFileRequest, runtime: Util.RuntimeOptions): FetchFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIdList)) {
    query['AndroidInstanceIdList'] = request.androidInstanceIdList;
  }
  if (!Util.isUnset(request.sourceFilePath)) {
    query['SourceFilePath'] = request.sourceFilePath;
  }
  if (!Util.isUnset(request.uploadEndpoint)) {
    query['UploadEndpoint'] = request.uploadEndpoint;
  }
  if (!Util.isUnset(request.uploadType)) {
    query['UploadType'] = request.uploadType;
  }
  if (!Util.isUnset(request.uploadUrl)) {
    query['UploadUrl'] = request.uploadUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FetchFile',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Pulls a file from a cloud phone instance and stores it in Object Storage Service (OSS).
 *
 * @description Currently, this operation allows you to retrieve files or folders from cloud phone instances and save them directly to OSS.
 *
 * @param request FetchFileRequest
 * @return FetchFileResponse
 */
async function fetchFile(request: FetchFileRequest): FetchFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return fetchFileWithOptions(request, runtime);
}

model GenerateCoordinationCodeRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='acp-2zecay9ponatdc4m****'),
  ownerUserId?: string(name='OwnerUserId', description='The ID of the user to whom the current instance is assigned.', example='xiaoming'),
}

model GenerateCoordinationCodeResponseBody = {
  coordinatorCode?: string(name='CoordinatorCode', description='The collaboration code.', example='CSHGDK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1A923337-44D9-5CAD-9A53-95084BD4****'),
}

model GenerateCoordinationCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateCoordinationCodeResponseBody(name='body'),
}

/**
 * @summary Generates a collaboration code for the cloud phone being accessed by using the current convenience account, and shares this code with other convenience accounts to allow them to access the same cloud phone.
 *
 * @description You can call this operation to generate a collaboration code for a cloud phone accessed by your current account and share this code with other convenience users to allow them to access the same cloud phone over the desktop, mobile, or web client.
 *
 * @param request GenerateCoordinationCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateCoordinationCodeResponse
 */
async function generateCoordinationCodeWithOptions(request: GenerateCoordinationCodeRequest, runtime: Util.RuntimeOptions): GenerateCoordinationCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerUserId)) {
    query['OwnerUserId'] = request.ownerUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateCoordinationCode',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a collaboration code for the cloud phone being accessed by using the current convenience account, and shares this code with other convenience accounts to allow them to access the same cloud phone.
 *
 * @description You can call this operation to generate a collaboration code for a cloud phone accessed by your current account and share this code with other convenience users to allow them to access the same cloud phone over the desktop, mobile, or web client.
 *
 * @param request GenerateCoordinationCodeRequest
 * @return GenerateCoordinationCodeResponse
 */
async function generateCoordinationCode(request: GenerateCoordinationCodeRequest): GenerateCoordinationCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateCoordinationCodeWithOptions(request, runtime);
}

model ImportKeyPairRequest {
  keyPairName?: string(name='KeyPairName', description='The name of the ADB key pair.

This parameter is required.', example='TestKeyPairName'),
  publicKeyBody?: string(name='PublicKeyBody', description='The public key of the ADB key pair.

This parameter is required.', example='ABC1234567*****'),
}

model ImportKeyPairResponseBody = {
  data?: {
    gmtCreated?: string(name='GmtCreated', description='The time when the ADB key pair was created.', example='2023-03-05T10:29:22Z'),
    keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.', example='kp-6v2q33ae4tw3*****'),
    keyPairName?: string(name='KeyPairName', description='The name of the ADB key pair.', example='TestKeyPairName'),
  }(name='Data', description='The object that is returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model ImportKeyPairResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportKeyPairResponseBody(name='body'),
}

/**
 * @summary Imports the public key of an Android Debug Bridge (ADB) key pair.
 *
 * @description To avoid authorization errors that could cause ADB connection failures, you must import the public key of an ADB key pair.
 *
 * @param request ImportKeyPairRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportKeyPairResponse
 */
async function importKeyPairWithOptions(request: ImportKeyPairRequest, runtime: Util.RuntimeOptions): ImportKeyPairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyPairName)) {
    query['KeyPairName'] = request.keyPairName;
  }
  if (!Util.isUnset(request.publicKeyBody)) {
    query['PublicKeyBody'] = request.publicKeyBody;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ImportKeyPair',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Imports the public key of an Android Debug Bridge (ADB) key pair.
 *
 * @description To avoid authorization errors that could cause ADB connection failures, you must import the public key of an ADB key pair.
 *
 * @param request ImportKeyPairRequest
 * @return ImportKeyPairResponse
 */
async function importKeyPair(request: ImportKeyPairRequest): ImportKeyPairResponse {
  var runtime = new Util.RuntimeOptions{};
  return importKeyPairWithOptions(request, runtime);
}

model InstallAppRequest {
  appIdList?: [ string ](name='AppIdList', description='The IDs of the apps that you want to install.'),
  instanceGroupIdList?: [ string ](name='InstanceGroupIdList', description='The IDs of the instance groups.'),
  instanceIdList?: [ string ](name='InstanceIdList', description='The IDs of the cloud phone instances.'),
}

model InstallAppResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5138F7E-46B5-526A-8C99-82DEAE6B****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='t-14xwibw7yp73q****'),
}

model InstallAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InstallAppResponseBody(name='body'),
}

/**
 * @summary Installs an app on multiple cloud phone instances at the same time.
 *
 * @description This operation runs asynchronously. To check the operation result, visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request InstallAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InstallAppResponse
 */
async function installAppWithOptions(request: InstallAppRequest, runtime: Util.RuntimeOptions): InstallAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appIdList)) {
    query['AppIdList'] = request.appIdList;
  }
  if (!Util.isUnset(request.instanceGroupIdList)) {
    query['InstanceGroupIdList'] = request.instanceGroupIdList;
  }
  if (!Util.isUnset(request.instanceIdList)) {
    query['InstanceIdList'] = request.instanceIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InstallApp',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Installs an app on multiple cloud phone instances at the same time.
 *
 * @description This operation runs asynchronously. To check the operation result, visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request InstallAppRequest
 * @return InstallAppResponse
 */
async function installApp(request: InstallAppRequest): InstallAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return installAppWithOptions(request, runtime);
}

model ListPolicyGroupsRequest {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Value range: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the request to retrieve a new page of results. If the parameter is left empty, the data is queried from the first entry.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kU+SQXzm0H9mu/FiSc****'),
  policyGroupIds?: [ string ](name='PolicyGroupIds', description='The IDs of the policies.'),
  policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='defaultPolicyGroup'),
  policyType?: string(name='PolicyType'),
}

model ListPolicyGroupsResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAV3MpHK1AP0pfERHZN5pu6l5V9uON****'),
  policyGroupModel?: [ 
    {
      cameraRedirect?: string(name='CameraRedirect', description='Specifies whether to enable the webcam redirection feature.

Valid values:

*   off
*   on', example='on'),
      clipboard?: string(name='Clipboard', description='The read/write permissions on the clipboard.

Valid values:

*   read: read-only.
*   readwrite: read and write.
*   off: read/write disabled.', example='readwrite'),
      gmtCreate?: string(name='GmtCreate', description='The time when the policy was created.', example='2024-06-04 10:28:54'),
      html5FileTransfer?: string(name='Html5FileTransfer', description='The file transfer policy of the HTML5 client.

Valid values:

*   all: File upload and download are supported.
*   download: Only file download is supported.
*   upload: Only file upload is supported.
*   off: File upload or download is forbidden.', example='download'),
      localDrive?: string(name='LocalDrive', description='The read/write permissions on the on-premises drive.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write denied.', example='off'),
      lockResolution?: string(name='LockResolution', description='Identifies whether the resolution is locked.

Valid values:

*   off
*   on', example='off'),
      netRedirectPolicy?: {
        customProxy?: string(name='CustomProxy', description='Indicates whether a custom proxy is manually configured.

Valid values:

*   off
*   on', example='off'),
        hostAddr?: string(name='HostAddr', description='The IPv4 address of the custom proxy.', example='47.100.XX.XX'),
        netRedirect?: string(name='NetRedirect', description='Indicates whether the network redirection feature is enabled. When this feature is enabled, network traffic is automatically redirected to the on-premises network by default.

Valid values:

*   off
*   on', example='off'),
        port?: string(name='Port', description='The port of the custom proxy. Valid values: 1 to 65535.', example='1145'),
        proxyPassword?: string(name='ProxyPassword', description='The password of the proxy. The password must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='password'),
        proxyType?: string(name='ProxyType', description='The type of the proxy protocol.

Valid values:

*   socks5.', example='socks5'),
        proxyUserName?: string(name='ProxyUserName', description='The username of the proxy. The name must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='username'),
        rules?: [ 
          {
            ruleType?: string(name='RuleType', description='The type of the rule.

Valid values:

*   prc: an application package name.
*   domain: a domain name.', example='domain'),
            target?: string(name='Target', description='The name of the application package or domain name.', example='*.example.com'),
          }
        ](name='Rules', description='The proxy rules.'),
      }(name='NetRedirectPolicy', description='The network redirection policy.'),
      policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-9q6o8qpiy8opkj****'),
      policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='Default Policy'),
      policyRelatedResources?: {
        androidInstanceGroupIds?: [ string ](name='AndroidInstanceGroupIds'),
        cloudPhoneMatrixIds?: [ string ](name='CloudPhoneMatrixIds'),
      }(name='PolicyRelatedResources'),
      sessionResolutionHeight?: int32(name='SessionResolutionHeight', description='The height of the resolution.', example='1080'),
      sessionResolutionWidth?: int32(name='SessionResolutionWidth', description='The width of the resolution.', example='1920'),
      watermark?: {
        watermarkColor?: int32(name='WatermarkColor'),
        watermarkCustomText?: string(name='WatermarkCustomText'),
        watermarkFontSize?: int32(name='WatermarkFontSize'),
        watermarkSwitch?: string(name='WatermarkSwitch'),
        watermarkTransparencyValue?: int32(name='WatermarkTransparencyValue'),
        watermarkTypes?: [ string ](name='WatermarkTypes'),
      }(name='Watermark'),
    }
  ](name='PolicyGroupModel', description='The policies.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7B9EFA4F-4305-5968-BAEE-BD8B8DE5****'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='31'),
}

model ListPolicyGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPolicyGroupsResponseBody(name='body'),
}

/**
 * @summary Queries policies.
 *
 * @param request ListPolicyGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPolicyGroupsResponse
 */
async function listPolicyGroupsWithOptions(request: ListPolicyGroupsRequest, runtime: Util.RuntimeOptions): ListPolicyGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policyGroupIds)) {
    body['PolicyGroupIds'] = request.policyGroupIds;
  }
  if (!Util.isUnset(request.policyGroupName)) {
    body['PolicyGroupName'] = request.policyGroupName;
  }
  if (!Util.isUnset(request.policyType)) {
    body['PolicyType'] = request.policyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListPolicyGroups',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries policies.
 *
 * @param request ListPolicyGroupsRequest
 * @return ListPolicyGroupsResponse
 */
async function listPolicyGroups(request: ListPolicyGroupsRequest): ListPolicyGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPolicyGroupsWithOptions(request, runtime);
}

model ModifyAndroidInstanceRequest {
  androidInstanceId?: string(name='AndroidInstanceId', description='The ID of the cloud phone instance.', example='acp-8v5bjld0r7tkl****'),
  newAndroidInstanceName?: string(name='NewAndroidInstanceName', description='The new name of the cloud phone instance.

>  The name can be up to 30 characters in length. It can contain letters, digits, colons (:), underscores (_), periods (.), or hyphens (-). It must start with letters but cannot start with http:// or https://.', example='new_name'),
}

model ModifyAndroidInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5138F7E-46B5-526A-8C99-82DEAE6B****'),
}

model ModifyAndroidInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAndroidInstanceResponseBody(name='body'),
}

/**
 * @summary Modifies attributes of a cloud phone instance. Currently, this operation allows you to modify only the name of a cloud phone instance.
 *
 * @param request ModifyAndroidInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAndroidInstanceResponse
 */
async function modifyAndroidInstanceWithOptions(request: ModifyAndroidInstanceRequest, runtime: Util.RuntimeOptions): ModifyAndroidInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceId)) {
    query['AndroidInstanceId'] = request.androidInstanceId;
  }
  if (!Util.isUnset(request.newAndroidInstanceName)) {
    query['NewAndroidInstanceName'] = request.newAndroidInstanceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAndroidInstance',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies attributes of a cloud phone instance. Currently, this operation allows you to modify only the name of a cloud phone instance.
 *
 * @param request ModifyAndroidInstanceRequest
 * @return ModifyAndroidInstanceResponse
 */
async function modifyAndroidInstance(request: ModifyAndroidInstanceRequest): ModifyAndroidInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAndroidInstanceWithOptions(request, runtime);
}

model ModifyAndroidInstanceGroupRequest {
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-cuv4scs4obxhs****'),
  newInstanceGroupName?: string(name='NewInstanceGroupName', description='The new name of the instance group.

> 

*   The name can be up to 30 characters in length. It can contain letters, digits, colons (:), underscores (_), periods (.), or hyphens (-). It must start with letters but cannot start with http:// or https://.', example='newName'),
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-2w97kp89gnsif****'),
}

model ModifyAndroidInstanceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6C83EBE3-F267-5F11-ABF8-4E7B90B****'),
}

model ModifyAndroidInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAndroidInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Modifies attributes of an instance group.
 *
 * @param request ModifyAndroidInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAndroidInstanceGroupResponse
 */
async function modifyAndroidInstanceGroupWithOptions(request: ModifyAndroidInstanceGroupRequest, runtime: Util.RuntimeOptions): ModifyAndroidInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  if (!Util.isUnset(request.newInstanceGroupName)) {
    query['NewInstanceGroupName'] = request.newInstanceGroupName;
  }
  if (!Util.isUnset(request.policyGroupId)) {
    query['PolicyGroupId'] = request.policyGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAndroidInstanceGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies attributes of an instance group.
 *
 * @param request ModifyAndroidInstanceGroupRequest
 * @return ModifyAndroidInstanceGroupResponse
 */
async function modifyAndroidInstanceGroup(request: ModifyAndroidInstanceGroupRequest): ModifyAndroidInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAndroidInstanceGroupWithOptions(request, runtime);
}

model ModifyAppRequest {
  appId?: int32(name='AppId', description='The ID of the application.', example='1234'),
  appName?: string(name='AppName', description='The name of the application.', example='defaultAppName'),
  description?: string(name='Description', description='The description of the application.', example='default description.'),
  iconUrl?: string(name='IconUrl', description='The URL of the icon.', example='https://defaultIcon.png'),
}

model ModifyAppResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='83418504-5A82-5896-A24C-B2D468F0****'),
}

model ModifyAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppResponseBody(name='body'),
}

/**
 * @summary Modify attributes of an application.
 *
 * @param request ModifyAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAppResponse
 */
async function modifyAppWithOptions(request: ModifyAppRequest, runtime: Util.RuntimeOptions): ModifyAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.iconUrl)) {
    query['IconUrl'] = request.iconUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApp',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modify attributes of an application.
 *
 * @param request ModifyAppRequest
 * @return ModifyAppResponse
 */
async function modifyApp(request: ModifyAppRequest): ModifyAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppWithOptions(request, runtime);
}

model ModifyCloudPhoneNodeRequest {
  newNodeName?: string(name='NewNodeName', description='The name that you want to assign to the cloud phone matrix.', example='node_name_new'),
  nodeId?: string(name='NodeId', description='The ID of the cloud phone matrix.', example='cpn-0ugbptfu473fy****'),
}

model ModifyCloudPhoneNodeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='7B9EFA4F-4305-5968-BAEE-BD8B8DE5****'),
}

model ModifyCloudPhoneNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCloudPhoneNodeResponseBody(name='body'),
}

/**
 * @summary Modifies a cloud phone matrix. Currently, you can only modify the name of a cloud phone matrix.
 *
 * @param request ModifyCloudPhoneNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCloudPhoneNodeResponse
 */
async function modifyCloudPhoneNodeWithOptions(request: ModifyCloudPhoneNodeRequest, runtime: Util.RuntimeOptions): ModifyCloudPhoneNodeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyCloudPhoneNode',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a cloud phone matrix. Currently, you can only modify the name of a cloud phone matrix.
 *
 * @param request ModifyCloudPhoneNodeRequest
 * @return ModifyCloudPhoneNodeResponse
 */
async function modifyCloudPhoneNode(request: ModifyCloudPhoneNodeRequest): ModifyCloudPhoneNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyCloudPhoneNodeWithOptions(request, runtime);
}

model ModifyInstanceChargeTypeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature. Default value: false.', example='false'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable the auto-renewal feature. Default value: false.', example='false'),
  chargeType?: string(name='ChargeType', description='The billing method. Valid values:

>  Currently, this operation only allows you to change the billing method from **pay-as-you-go to subscription**.

This parameter is required.', example='PrePaid'),
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.

This parameter is required.'),
  period?: int32(name='Period', description='The subscription duration. The unit is specified by PeriodUnit. Valid values: 1 Month, 2 Months, 3 Months, 6 Months, and 1 Year.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration. Valid values:

*   **Month**
*   **Year**', example='Month'),
}

model ModifyInstanceChargeTypeResponseBody = {
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='22326560487****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1A923337-44D9-5CAD-9A53-95084BD4****'),
}

model ModifyInstanceChargeTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceChargeTypeResponseBody(name='body'),
}

/**
 * @summary Modifies the billing method. Currently, this operation only allows you to change the billing method from pay-as-you-go to subscription.
 *
 * @param request ModifyInstanceChargeTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceChargeTypeResponse
 */
async function modifyInstanceChargeTypeWithOptions(request: ModifyInstanceChargeTypeRequest, runtime: Util.RuntimeOptions): ModifyInstanceChargeTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.instanceGroupIds)) {
    query['InstanceGroupIds'] = request.instanceGroupIds;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceChargeType',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the billing method. Currently, this operation only allows you to change the billing method from pay-as-you-go to subscription.
 *
 * @param request ModifyInstanceChargeTypeRequest
 * @return ModifyInstanceChargeTypeResponse
 */
async function modifyInstanceChargeType(request: ModifyInstanceChargeTypeRequest): ModifyInstanceChargeTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceChargeTypeWithOptions(request, runtime);
}

model ModifyKeyPairNameRequest {
  keyPairId?: string(name='KeyPairId', description='The ID of the ADB key pair.

This parameter is required.', example='kp-6v2q33ae4tw3a****'),
  newKeyPairName?: string(name='NewKeyPairName', description='The name of the ADB key pair.

This parameter is required.', example='newKeyPairName'),
}

model ModifyKeyPairNameResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model ModifyKeyPairNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyKeyPairNameResponseBody(name='body'),
}

/**
 * @summary Modifies Android Debug Bridge (ADB) key pairs.
 *
 * @param request ModifyKeyPairNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyKeyPairNameResponse
 */
async function modifyKeyPairNameWithOptions(request: ModifyKeyPairNameRequest, runtime: Util.RuntimeOptions): ModifyKeyPairNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyPairId)) {
    query['KeyPairId'] = request.keyPairId;
  }
  if (!Util.isUnset(request.newKeyPairName)) {
    query['NewKeyPairName'] = request.newKeyPairName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyKeyPairName',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies Android Debug Bridge (ADB) key pairs.
 *
 * @param request ModifyKeyPairNameRequest
 * @return ModifyKeyPairNameResponse
 */
async function modifyKeyPairName(request: ModifyKeyPairNameRequest): ModifyKeyPairNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyKeyPairNameWithOptions(request, runtime);
}

model ModifyPolicyGroupRequest {
  cameraRedirect?: string(name='CameraRedirect', description='Specifies whether to enable the webcam redirection feature.

Valid values:

*   off
*   on', example='off'),
  clipboard?: string(name='Clipboard', description='The read/write permissions on the clipboard.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='readwrite'),
  html5FileTransfer?: string(name='Html5FileTransfer', description='The file transfer policy of the Alibaba Cloud Workspace web client.

Valid values:

*   all: File upload and download are supported.
*   download: Only file download is supported.
*   upload: Only file upload is supported.
*   off: File upload or download is forbidden.', example='off'),
  localDrive?: string(name='LocalDrive', description='The read/write permissions on the on-premises drive.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='off'),
  lockResolution?: string(name='LockResolution', description='Specifies whether to lock the resolution.

Valid values:

*   off
*   on', example='off'),
  netRedirectPolicy?: {
    customProxy?: string(name='CustomProxy', description='Specifies whether to manually configure a custom proxy.

Valid values:

*   off
*   on', example='off'),
    hostAddr?: string(name='HostAddr', description='The IPv4 address of the custom proxy.', example='47.100.XX.XX'),
    netRedirect?: string(name='NetRedirect', description='Specifies whether to enable network redirection.

Valid values:

*   off
*   on', example='off'),
    port?: string(name='Port', description='The port of the custom proxy. Valid values: 1 to 65535.', example='1145'),
    proxyPassword?: string(name='ProxyPassword', description='The password of the proxy. The password must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='password'),
    proxyType?: string(name='ProxyType', description='The type of the proxy protocol.

Valid values:

*   socks5.', example='socks5'),
    proxyUserName?: string(name='ProxyUserName', description='The username of the proxy. The name must be 1 to 256 in length and cannot contain Chinese character or space characters.', example='username'),
    rules?: [ 
      {
        ruleType?: string(name='RuleType'),
        target?: string(name='Target'),
      }
    ](name='Rules'),
  }(name='NetRedirectPolicy', description='The network redirection policy.'),
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-4bi18ebi9tfjh****'),
  policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='defaultPolicyGroup'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution. Unit: pixels.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution. Unit: pixels.', example='720'),
  watermark?: {
    watermarkColor?: int32(name='WatermarkColor'),
    watermarkCustomText?: string(name='WatermarkCustomText'),
    watermarkFontSize?: int32(name='WatermarkFontSize'),
    watermarkSwitch?: string(name='WatermarkSwitch'),
    watermarkTransparencyValue?: int32(name='WatermarkTransparencyValue'),
    watermarkTypes?: [ string ](name='WatermarkTypes'),
  }(name='Watermark'),
}

model ModifyPolicyGroupShrinkRequest {
  cameraRedirect?: string(name='CameraRedirect', description='Specifies whether to enable the webcam redirection feature.

Valid values:

*   off
*   on', example='off'),
  clipboard?: string(name='Clipboard', description='The read/write permissions on the clipboard.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='readwrite'),
  html5FileTransfer?: string(name='Html5FileTransfer', description='The file transfer policy of the Alibaba Cloud Workspace web client.

Valid values:

*   all: File upload and download are supported.
*   download: Only file download is supported.
*   upload: Only file upload is supported.
*   off: File upload or download is forbidden.', example='off'),
  localDrive?: string(name='LocalDrive', description='The read/write permissions on the on-premises drive.

Valid values:

*   read: read-only.
*   readwrite: ready and write.
*   off: read/write disabled.', example='off'),
  lockResolution?: string(name='LockResolution', description='Specifies whether to lock the resolution.

Valid values:

*   off
*   on', example='off'),
  netRedirectPolicyShrink?: string(name='NetRedirectPolicy', description='The network redirection policy.'),
  policyGroupId?: string(name='PolicyGroupId', description='The ID of the policy.', example='pg-4bi18ebi9tfjh****'),
  policyGroupName?: string(name='PolicyGroupName', description='The name of the policy.', example='defaultPolicyGroup'),
  resolutionHeight?: int32(name='ResolutionHeight', description='The height of the resolution. Unit: pixels.', example='1280'),
  resolutionWidth?: int32(name='ResolutionWidth', description='The width of the resolution. Unit: pixels.', example='720'),
  watermarkShrink?: string(name='Watermark'),
}

model ModifyPolicyGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='552B7EED-D434-511F-B838-29EA4E906034'),
}

model ModifyPolicyGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPolicyGroupResponseBody(name='body'),
}

/**
 * @summary Modifies a policy.
 *
 * @param tmpReq ModifyPolicyGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyPolicyGroupResponse
 */
async function modifyPolicyGroupWithOptions(tmpReq: ModifyPolicyGroupRequest, runtime: Util.RuntimeOptions): ModifyPolicyGroupResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyPolicyGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.netRedirectPolicy)) {
    request.netRedirectPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.netRedirectPolicy, 'NetRedirectPolicy', 'json');
  }
  if (!Util.isUnset(tmpReq.watermark)) {
    request.watermarkShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.watermark, 'Watermark', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.cameraRedirect)) {
    body['CameraRedirect'] = request.cameraRedirect;
  }
  if (!Util.isUnset(request.clipboard)) {
    body['Clipboard'] = request.clipboard;
  }
  if (!Util.isUnset(request.html5FileTransfer)) {
    body['Html5FileTransfer'] = request.html5FileTransfer;
  }
  if (!Util.isUnset(request.localDrive)) {
    body['LocalDrive'] = request.localDrive;
  }
  if (!Util.isUnset(request.lockResolution)) {
    body['LockResolution'] = request.lockResolution;
  }
  if (!Util.isUnset(request.netRedirectPolicyShrink)) {
    body['NetRedirectPolicy'] = request.netRedirectPolicyShrink;
  }
  if (!Util.isUnset(request.policyGroupId)) {
    body['PolicyGroupId'] = request.policyGroupId;
  }
  if (!Util.isUnset(request.policyGroupName)) {
    body['PolicyGroupName'] = request.policyGroupName;
  }
  if (!Util.isUnset(request.resolutionHeight)) {
    body['ResolutionHeight'] = request.resolutionHeight;
  }
  if (!Util.isUnset(request.resolutionWidth)) {
    body['ResolutionWidth'] = request.resolutionWidth;
  }
  if (!Util.isUnset(request.watermarkShrink)) {
    body['Watermark'] = request.watermarkShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyPolicyGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a policy.
 *
 * @param request ModifyPolicyGroupRequest
 * @return ModifyPolicyGroupResponse
 */
async function modifyPolicyGroup(request: ModifyPolicyGroupRequest): ModifyPolicyGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyPolicyGroupWithOptions(request, runtime);
}

model OperateAppRequest {
  appId?: int32(name='AppId', description='The ID of the app.', example='1234'),
  instanceIdList?: [ string ](name='InstanceIdList', description='The IDs of the cloud phone instances.'),
  operateType?: string(name='OperateType', description='The type of the operation.

Valid values:

*   stop: closes the app.
*   restart: reopens the app.
*   start: open the app.', example='start'),
}

model OperateAppResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='t-imr0fufqgac2z****'),
}

model OperateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateAppResponseBody(name='body'),
}

/**
 * @summary Operates apps in a cloud phone, such as opening, closing, and reopening apps.
 *
 * @description This operation runs asynchronously. To check the operation result, visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request OperateAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateAppResponse
 */
async function operateAppWithOptions(request: OperateAppRequest, runtime: Util.RuntimeOptions): OperateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.instanceIdList)) {
    query['InstanceIdList'] = request.instanceIdList;
  }
  if (!Util.isUnset(request.operateType)) {
    query['OperateType'] = request.operateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OperateApp',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Operates apps in a cloud phone, such as opening, closing, and reopening apps.
 *
 * @description This operation runs asynchronously. To check the operation result, visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request OperateAppRequest
 * @return OperateAppResponse
 */
async function operateApp(request: OperateAppRequest): OperateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateAppWithOptions(request, runtime);
}

model RebootAndroidInstancesInGroupRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='The IDs of the cloud phone instances.'),
  forceStop?: boolean(name='ForceStop', description='Specifies whether to enforce a restart operation. If a cloud phone instance fails to stop due to system or network issues, a forced restart can be triggered, though it may result in data loss.

Valid values:

*   true
*   false', example='false'),
  saleMode?: string(name='SaleMode'),
}

model RebootAndroidInstancesInGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='227CBB4C-F5DC-589D-A667-C5CA3D52****'),
}

model RebootAndroidInstancesInGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RebootAndroidInstancesInGroupResponseBody(name='body'),
}

/**
 * @summary Restarts one or more cloud phone instances.
 *
 * @description Before you restart a cloud phone instance, make sure it is in one of the following states: **Available, Abnormal, Backup failure, and Restoration failure**.
 *
 * @param request RebootAndroidInstancesInGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RebootAndroidInstancesInGroupResponse
 */
async function rebootAndroidInstancesInGroupWithOptions(request: RebootAndroidInstancesInGroupRequest, runtime: Util.RuntimeOptions): RebootAndroidInstancesInGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.forceStop)) {
    query['ForceStop'] = request.forceStop;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RebootAndroidInstancesInGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Restarts one or more cloud phone instances.
 *
 * @description Before you restart a cloud phone instance, make sure it is in one of the following states: **Available, Abnormal, Backup failure, and Restoration failure**.
 *
 * @param request RebootAndroidInstancesInGroupRequest
 * @return RebootAndroidInstancesInGroupResponse
 */
async function rebootAndroidInstancesInGroup(request: RebootAndroidInstancesInGroupRequest): RebootAndroidInstancesInGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return rebootAndroidInstancesInGroupWithOptions(request, runtime);
}

model RecoveryFileRequest {
  androidInstanceIdList?: [ string ](name='AndroidInstanceIdList', description='The IDs of the instances.

This parameter is required.'),
  backupAll?: boolean(name='BackupAll', description='Specifies whether to back up the whole instance.', example='true'),
  backupFileId?: string(name='BackupFileId', description='The ID of the backup file.', example='bf-azhps4rdyi2th****'),
  backupFilePath?: string(name='BackupFilePath', description='The OSS path to which the backup file is uploaded.

>  When calling the describeBuckets operation to retrieve a bucket name, you must also call the ossObjectList operation to obtain the object key. Combine these to form the full path: oss://${bucketName}/${key}.'),
  uploadEndpoint?: string(name='UploadEndpoint', description='The endpoint of the OSS bucket that stores the backup file.

> : When calling the DescribeBuckets operation to query buckets, retrieve the IntranetEndpoint value if the cloud phone and the OSS bucket are in the same region. If they are in different regions, retrieve the ExtranetEndpoint value instead.', example='oss-cn-hangzhou-internal.aliyuncs.com'),
  uploadType?: string(name='UploadType', description='The type of the backup.

Valid values:

*   OSS: backup files are stored in OSS buckets.', example='OSS'),
}

model RecoveryFileResponseBody = {
  count?: long(name='Count', description='The number of restored instances.', example='97'),
  data?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId', description='The instance ID.', example='acp-34pqe4r0kd9kn****'),
      taskId?: string(name='TaskId', description='The task ID.', example='t-5prhfo7wv1gjx****'),
    }
  ](name='Data', description='The backup file that is restored.', example='6AD56E39-430B-5401-AB4A-7B086454****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6AD56E39-430B-5401-AB4A-7B086454****'),
  taskId?: string(name='TaskId', description='The ID of the batch task.', example='t-5prhfo7wv1gjx****'),
}

model RecoveryFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RecoveryFileResponseBody(name='body'),
}

/**
 * @summary Restores backup files.
 *
 * @description Currently, this operation allows you to restore only backup files generated by cloud phones that are stored in Object Storage Service (OSS) buckets.
 *
 * @param request RecoveryFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RecoveryFileResponse
 */
async function recoveryFileWithOptions(request: RecoveryFileRequest, runtime: Util.RuntimeOptions): RecoveryFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIdList)) {
    query['AndroidInstanceIdList'] = request.androidInstanceIdList;
  }
  if (!Util.isUnset(request.backupAll)) {
    query['BackupAll'] = request.backupAll;
  }
  if (!Util.isUnset(request.backupFileId)) {
    query['BackupFileId'] = request.backupFileId;
  }
  if (!Util.isUnset(request.backupFilePath)) {
    query['BackupFilePath'] = request.backupFilePath;
  }
  if (!Util.isUnset(request.uploadEndpoint)) {
    query['UploadEndpoint'] = request.uploadEndpoint;
  }
  if (!Util.isUnset(request.uploadType)) {
    query['UploadType'] = request.uploadType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoveryFile',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Restores backup files.
 *
 * @description Currently, this operation allows you to restore only backup files generated by cloud phones that are stored in Object Storage Service (OSS) buckets.
 *
 * @param request RecoveryFileRequest
 * @return RecoveryFileResponse
 */
async function recoveryFile(request: RecoveryFileRequest): RecoveryFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return recoveryFileWithOptions(request, runtime);
}

model RenewAndroidInstanceGroupsRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature.

Valid values:

*   true: enables the auto-payment feature. Ensure your account has sufficient balance to use this feature.
*   false: disables the auto-payment feature. You need to manually complete the payment process.', example='true'),
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.'),
  period?: int32(name='Period', description='The duration of the renewal, measured in units defined by PeriodUnit.', example='6'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the renewal duration. Default value: Month.

Valid values:

*   Month
*   Year', example='Month'),
}

model RenewAndroidInstanceGroupsResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='22326560487****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B886792-2051-5DB4-8AE6-C8E45D3B4****'),
}

model RenewAndroidInstanceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewAndroidInstanceGroupsResponseBody(name='body'),
}

/**
 * @summary Renews instance groups.
 *
 * @param request RenewAndroidInstanceGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewAndroidInstanceGroupsResponse
 */
async function renewAndroidInstanceGroupsWithOptions(request: RenewAndroidInstanceGroupsRequest, runtime: Util.RuntimeOptions): RenewAndroidInstanceGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.instanceGroupIds)) {
    query['InstanceGroupIds'] = request.instanceGroupIds;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RenewAndroidInstanceGroups',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Renews instance groups.
 *
 * @param request RenewAndroidInstanceGroupsRequest
 * @return RenewAndroidInstanceGroupsResponse
 */
async function renewAndroidInstanceGroups(request: RenewAndroidInstanceGroupsRequest): RenewAndroidInstanceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewAndroidInstanceGroupsWithOptions(request, runtime);
}

model RenewCloudPhoneNodesRequest {
  autoPay?: boolean(name='AutoPay'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable the auto-renewal feature.

Valid values:

*   true: enables the auto-renewal feature. In this case, the system automatically renews the instance upon expiration.
*   false (default): disables the auto-renewal feature. In this case, you need to manually renew the instance upon expiration.', example='true'),
  nodeIds?: [ string ](name='NodeIds', description='The cloud phone matrix IDs.'),
  period?: int32(name='Period', description='The subscription duration. The unit is specified by `PeriodUnit`. Valid values:

*   When `PeriodUnit` is set to **year**: 1.
*   When `PeriodUnit` is set to **month**: 1, 2, 3, and 6.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the subscription duration.

Valid values:

*   Month (default)
*   Year', example='Month'),
}

model RenewCloudPhoneNodesResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='22365781890****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC****'),
}

model RenewCloudPhoneNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewCloudPhoneNodesResponseBody(name='body'),
}

/**
 * @summary Renews a cloud mobile matrix.
 *
 * @param request RenewCloudPhoneNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewCloudPhoneNodesResponse
 */
async function renewCloudPhoneNodesWithOptions(request: RenewCloudPhoneNodesRequest, runtime: Util.RuntimeOptions): RenewCloudPhoneNodesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.autoRenew)) {
    body['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.nodeIds)) {
    body['NodeIds'] = request.nodeIds;
  }
  if (!Util.isUnset(request.period)) {
    body['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    body['PeriodUnit'] = request.periodUnit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RenewCloudPhoneNodes',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Renews a cloud mobile matrix.
 *
 * @param request RenewCloudPhoneNodesRequest
 * @return RenewCloudPhoneNodesResponse
 */
async function renewCloudPhoneNodes(request: RenewCloudPhoneNodesRequest): RenewCloudPhoneNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewCloudPhoneNodesWithOptions(request, runtime);
}

model ResetAndroidInstancesInGroupRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='The IDs of the cloud phone instances.'),
  saleMode?: string(name='SaleMode'),
}

model ResetAndroidInstancesInGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model ResetAndroidInstancesInGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAndroidInstancesInGroupResponseBody(name='body'),
}

/**
 * @summary Resets one or more cloud phone instances.
 *
 * @description Before you reset a cloud phone instance, make sure it is in one of the following states: **Available, Stopped, Abnormal, Backup failure, and Restoration failure**.
 *
 * @param request ResetAndroidInstancesInGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAndroidInstancesInGroupResponse
 */
async function resetAndroidInstancesInGroupWithOptions(request: ResetAndroidInstancesInGroupRequest, runtime: Util.RuntimeOptions): ResetAndroidInstancesInGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAndroidInstancesInGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resets one or more cloud phone instances.
 *
 * @description Before you reset a cloud phone instance, make sure it is in one of the following states: **Available, Stopped, Abnormal, Backup failure, and Restoration failure**.
 *
 * @param request ResetAndroidInstancesInGroupRequest
 * @return ResetAndroidInstancesInGroupResponse
 */
async function resetAndroidInstancesInGroup(request: ResetAndroidInstancesInGroupRequest): ResetAndroidInstancesInGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAndroidInstancesInGroupWithOptions(request, runtime);
}

model RunCommandRequest {
  commandContent?: string(name='CommandContent', description='The content of the command.', example='ls'),
  contentEncoding?: string(name='ContentEncoding', description='The encoding method of the command content (`CommandContent`). The value is not case-sensitive.

>  If you set the value to an invalid encoding method, the system will process the command content as `PlainText`.

Valid values:

*   Base64: encodes the command content in Base64.
*   PlainText (default): does not encode the command content. The command content is input as plain text.', example='PlainText'),
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.'),
  timeout?: long(name='Timeout', description='The timeout period of the command execution. If the command execution exceeds the timeout period, it will be considered timed out. If you leave this parameter empty, it defaults to 60.', example='60'),
}

model RunCommandResponseBody = {
  invokeId?: string(name='InvokeId', description='The ID of the command execution. You can use the command execution ID to query the output of a command.', example='t-gov2ujrk32v4****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='440D7342-5E7C-B2DB-D0B4EAC2BDF1****'),
}

model RunCommandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunCommandResponseBody(name='body'),
}

/**
 * @summary Executes a command on a cloud phone instance.
 *
 * @param request RunCommandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunCommandResponse
 */
async function runCommandWithOptions(request: RunCommandRequest, runtime: Util.RuntimeOptions): RunCommandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.commandContent)) {
    query['CommandContent'] = request.commandContent;
  }
  if (!Util.isUnset(request.contentEncoding)) {
    query['ContentEncoding'] = request.contentEncoding;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.timeout)) {
    query['Timeout'] = request.timeout;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RunCommand',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Executes a command on a cloud phone instance.
 *
 * @param request RunCommandRequest
 * @return RunCommandResponse
 */
async function runCommand(request: RunCommandRequest): RunCommandResponse {
  var runtime = new Util.RuntimeOptions{};
  return runCommandWithOptions(request, runtime);
}

model SendFileRequest {
  androidInstanceIdList?: [ string ](name='AndroidInstanceIdList', description='The IDs of the cloud phone instances.

This parameter is required.'),
  sourceFilePath?: string(name='SourceFilePath', description='The path to which you want to upload the pushed file in the cloud phone instance.

This parameter is required.', example='/data'),
  targetFileName?: string(name='TargetFileName', description='The name of the file uploaded from the Object Storage Service (OSS) to the cloud phone instance.

>  If UploadType is set to OSS, you must specify TargetFileName. If TargetFileName is empty, the file uploaded from the OSS bucket to the cloud phone instance retains its original name. If TargetFileName is provided with a value, the uploaded file in the SourceFilePath directory uses the specified name (TargetFileName). If UploadType is set to DOWNLOAD_URL, TargetFileName does not take effect.', example='test.txt'),
  uploadEndpoint?: string(name='UploadEndpoint', description='The endpoint of the OSS bucket in which the file is stored.

>  Set the value to an internal endpoint when the cloud phone instance and the OSS bucket are in the same region to improve transfer speed without incurring public traffic fees. Sample endpoint: `oss-cn-hangzhou-internal.aliyuncs.com`. For more information, see [OSS regions and endpoints](https://help.aliyun.com/document_detail/31837.html).', example='oss-cn-hangzhou.aliyuncs.com'),
  uploadType?: string(name='UploadType', description='The storage type of the file that you want to upload.

*   Set the value to OSS.

This parameter is required.', example='OSS'),
  uploadUrl?: string(name='UploadUrl', description='The OSS URL of the file.

>  The OSS bucket name must start with "cloudphone-saved-bucket-", for example, "cloudphone-saved-bucket-example". You must also create an OSS directory to store the backup data. Set the value for UploadUrl in this format: oss://\\\\<BucketName>/\\\\<OSSDirectoryName>\\\\<FileName>.

This parameter is required.'),
}

model SendFileResponseBody = {
  data?: [ 
    {
      androidInstanceId?: string(name='AndroidInstanceId'),
      taskId?: string(name='TaskId'),
    }
  ](name='Data', description='The objects that are returned.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  requestId?: string(name='RequestId', description='The ID of the request. If the request fails, share this ID with technical support to help diagnose the issue.', example='425F351C-3F8E-5218-A520-B6311D0D****'),
  taskId?: string(name='TaskId', description='The ID of the batch task.', example='t-ehs0yoedj0xe9****'),
}

model SendFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendFileResponseBody(name='body'),
}

/**
 * @summary Pushes files from Object Storage Service (OSS) buckets to cloud phone instances.
 *
 * @description Currently, this operation allows you to only push files or folders from OSS buckets to cloud phone instances.
 *
 * @param request SendFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendFileResponse
 */
async function sendFileWithOptions(request: SendFileRequest, runtime: Util.RuntimeOptions): SendFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIdList)) {
    query['AndroidInstanceIdList'] = request.androidInstanceIdList;
  }
  if (!Util.isUnset(request.sourceFilePath)) {
    query['SourceFilePath'] = request.sourceFilePath;
  }
  if (!Util.isUnset(request.targetFileName)) {
    query['TargetFileName'] = request.targetFileName;
  }
  if (!Util.isUnset(request.uploadEndpoint)) {
    query['UploadEndpoint'] = request.uploadEndpoint;
  }
  if (!Util.isUnset(request.uploadType)) {
    query['UploadType'] = request.uploadType;
  }
  if (!Util.isUnset(request.uploadUrl)) {
    query['UploadUrl'] = request.uploadUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendFile',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Pushes files from Object Storage Service (OSS) buckets to cloud phone instances.
 *
 * @description Currently, this operation allows you to only push files or folders from OSS buckets to cloud phone instances.
 *
 * @param request SendFileRequest
 * @return SendFileResponse
 */
async function sendFile(request: SendFileRequest): SendFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendFileWithOptions(request, runtime);
}

model SetAdbSecureRequest {
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.'),
  status?: int32(name='Status', description='The status of the ADB authentication feature.

Valid values:

*   0: The ADB authentication feature is disabled.
*   1: The ADB authentication feature is enabled.

This parameter is required.', example='1'),
}

model SetAdbSecureResponseBody = {
  data?: {
    failCount?: int32(name='FailCount', description='The number of the cloud phone instances for which the ADB authentication feature failed to be enabled.', example='0'),
    instanceIds?: [ string ](name='InstanceIds', description='The IDs of the cloud phone instances for which the ADB authentication feature is enabled.'),
    totalCount?: int32(name='TotalCount', description='The total number of the cloud phone instances.', example='100'),
  }(name='Data', description='The returned object.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='69BCBBE4-FCF2-59B8-AD9D-531EB422****'),
}

model SetAdbSecureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetAdbSecureResponseBody(name='body'),
}

/**
 * @summary Sets the authentication status for cloud phone instances. If you enable Android Debug Bridge (ADB) authentication for cloud phone instances, the system will verify the validity of the ADB key pairs provided by end users when they connect to the instances over ADB. To ensure successful authentication and a proper connection, we recommend that you attach ADB key pairs to cloud phone instances. If you disable ADB authentication for cloud phone instances, the system will no longer verify the validity of any ADB key pairs. As a result, end users can connect to the cloud phone instances over ADB without authentication, provided the network connection is functioning properly.
 *
 * @description Before you call this operation, make sure that the desired cloud phone instance is in the Running state.
 *
 * @param request SetAdbSecureRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetAdbSecureResponse
 */
async function setAdbSecureWithOptions(request: SetAdbSecureRequest, runtime: Util.RuntimeOptions): SetAdbSecureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAdbSecure',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sets the authentication status for cloud phone instances. If you enable Android Debug Bridge (ADB) authentication for cloud phone instances, the system will verify the validity of the ADB key pairs provided by end users when they connect to the instances over ADB. To ensure successful authentication and a proper connection, we recommend that you attach ADB key pairs to cloud phone instances. If you disable ADB authentication for cloud phone instances, the system will no longer verify the validity of any ADB key pairs. As a result, end users can connect to the cloud phone instances over ADB without authentication, provided the network connection is functioning properly.
 *
 * @description Before you call this operation, make sure that the desired cloud phone instance is in the Running state.
 *
 * @param request SetAdbSecureRequest
 * @return SetAdbSecureResponse
 */
async function setAdbSecure(request: SetAdbSecureRequest): SetAdbSecureResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAdbSecureWithOptions(request, runtime);
}

model StartAndroidInstanceRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='List of instances.'),
  saleMode?: string(name='SaleMode'),
}

model StartAndroidInstanceResponseBody = {
  requestId?: string(name='RequestId', description='Request ID.', example='17C731AB-AAEE-5844-A352-D8D0352D****'),
}

model StartAndroidInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartAndroidInstanceResponseBody(name='body'),
}

/**
 * @summary Start instances.
 *
 * @description Only supports starting when the instance is in the **Stopped, Backup Failed, or Recovery Failed** state.
 *
 * @param request StartAndroidInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartAndroidInstanceResponse
 */
async function startAndroidInstanceWithOptions(request: StartAndroidInstanceRequest, runtime: Util.RuntimeOptions): StartAndroidInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartAndroidInstance',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Start instances.
 *
 * @description Only supports starting when the instance is in the **Stopped, Backup Failed, or Recovery Failed** state.
 *
 * @param request StartAndroidInstanceRequest
 * @return StartAndroidInstanceResponse
 */
async function startAndroidInstance(request: StartAndroidInstanceRequest): StartAndroidInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return startAndroidInstanceWithOptions(request, runtime);
}

model StopAndroidInstanceRequest {
  androidInstanceIds?: [ string ](name='AndroidInstanceIds', description='The IDs of the cloud phone instances.'),
  forceStop?: boolean(name='ForceStop', description='Specifies whether to enforce a stop operation. If a cloud phone instance fails to stop due to system or network issues, a forced stop can be triggered, though it may result in data loss.', example='false'),
  saleMode?: string(name='SaleMode'),
}

model StopAndroidInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E38B41A8-8E00-5AE4-A957-6636ACB8****'),
}

model StopAndroidInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopAndroidInstanceResponseBody(name='body'),
}

/**
 * @summary Stops a cloud phone instance.
 *
 * @description Before you stop a cloud phone instance, make sure it is in one of the following states: **Available, Backup failure, and Restoration failure**.
 *
 * @param request StopAndroidInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopAndroidInstanceResponse
 */
async function stopAndroidInstanceWithOptions(request: StopAndroidInstanceRequest, runtime: Util.RuntimeOptions): StopAndroidInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.androidInstanceIds)) {
    query['AndroidInstanceIds'] = request.androidInstanceIds;
  }
  if (!Util.isUnset(request.forceStop)) {
    query['ForceStop'] = request.forceStop;
  }
  if (!Util.isUnset(request.saleMode)) {
    query['SaleMode'] = request.saleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopAndroidInstance',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stops a cloud phone instance.
 *
 * @description Before you stop a cloud phone instance, make sure it is in one of the following states: **Available, Backup failure, and Restoration failure**.
 *
 * @param request StopAndroidInstanceRequest
 * @return StopAndroidInstanceResponse
 */
async function stopAndroidInstance(request: StopAndroidInstanceRequest): StopAndroidInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopAndroidInstanceWithOptions(request, runtime);
}

model UninstallAppRequest {
  appIdList?: [ string ](name='AppIdList', description='The IDs of the apps.'),
  instanceGroupIdList?: [ string ](name='InstanceGroupIdList', description='The ID of the instance groups. If you specify this parameter, you cannot specify InstanceIdList.'),
  instanceIdList?: [ string ](name='InstanceIdList', description='The IDs of the cloud phone instances. If you specify this parameter, you cannot specify InstanceGroupIdList.'),
}

model UninstallAppResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5138F7E-46B5-526A-8C99-82DEAE6B****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='t-1ljew7on6ay0j****'),
}

model UninstallAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UninstallAppResponseBody(name='body'),
}

/**
 * @summary Uninstalls an app from multiple cloud phone instances.
 *
 * @description This operation runs asynchronously. To check the operation result, you can visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request UninstallAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UninstallAppResponse
 */
async function uninstallAppWithOptions(request: UninstallAppRequest, runtime: Util.RuntimeOptions): UninstallAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appIdList)) {
    query['AppIdList'] = request.appIdList;
  }
  if (!Util.isUnset(request.instanceGroupIdList)) {
    query['InstanceGroupIdList'] = request.instanceGroupIdList;
  }
  if (!Util.isUnset(request.instanceIdList)) {
    query['InstanceIdList'] = request.instanceIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UninstallApp',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Uninstalls an app from multiple cloud phone instances.
 *
 * @description This operation runs asynchronously. To check the operation result, you can visit the Task Center. To retrieve task details, call the [DescribeTasks](~~DescribeTasks~~) operation.
 *
 * @param request UninstallAppRequest
 * @return UninstallAppResponse
 */
async function uninstallApp(request: UninstallAppRequest): UninstallAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return uninstallAppWithOptions(request, runtime);
}

model UpdateCustomImageNameRequest {
  imageId?: string(name='ImageId', description='The ID of the image.', example='imgc-075cllfeuazh0****'),
  imageName?: string(name='ImageName', description='The name of the image.', example='imagename'),
}

model UpdateCustomImageNameResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='552B7EED-D434-511F-B838-29EA4E906034'),
}

model UpdateCustomImageNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomImageNameResponseBody(name='body'),
}

/**
 * @summary Updates the name of a custom image.
 *
 * @param request UpdateCustomImageNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomImageNameResponse
 */
async function updateCustomImageNameWithOptions(request: UpdateCustomImageNameRequest, runtime: Util.RuntimeOptions): UpdateCustomImageNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageId)) {
    body['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.imageName)) {
    body['ImageName'] = request.imageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomImageName',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the name of a custom image.
 *
 * @param request UpdateCustomImageNameRequest
 * @return UpdateCustomImageNameResponse
 */
async function updateCustomImageName(request: UpdateCustomImageNameRequest): UpdateCustomImageNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomImageNameWithOptions(request, runtime);
}

model UpdateInstanceGroupImageRequest {
  imageId?: string(name='ImageId', description='The ID of the image.

This parameter is required.', example='imgc-075cllfeuazh****'),
  instanceGroupIds?: [ string ](name='InstanceGroupIds', description='The IDs of the instance groups.

This parameter is required.'),
}

model UpdateInstanceGroupImageResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='55726272-E40B-530D-914F-5126B19C79B3'),
}

model UpdateInstanceGroupImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceGroupImageResponseBody(name='body'),
}

/**
 * @summary Changes the image of an instance group.
 *
 * @description Before you call this operation, make sure the image is in the Available state and the region of the image is included in the region list of the desired instance group. In addition, the instance group itself is available.
 *
 * @param request UpdateInstanceGroupImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceGroupImageResponse
 */
async function updateInstanceGroupImageWithOptions(request: UpdateInstanceGroupImageRequest, runtime: Util.RuntimeOptions): UpdateInstanceGroupImageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageId)) {
    body['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.instanceGroupIds)) {
    body['InstanceGroupIds'] = request.instanceGroupIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceGroupImage',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the image of an instance group.
 *
 * @description Before you call this operation, make sure the image is in the Available state and the region of the image is included in the region list of the desired instance group. In addition, the instance group itself is available.
 *
 * @param request UpdateInstanceGroupImageRequest
 * @return UpdateInstanceGroupImageResponse
 */
async function updateInstanceGroupImage(request: UpdateInstanceGroupImageRequest): UpdateInstanceGroupImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceGroupImageWithOptions(request, runtime);
}

model UpdateInstanceImageRequest {
  imageId?: string(name='ImageId', example='imgc-075cllfeuazh0****'),
  instanceIdList?: [ string ](name='InstanceIdList'),
}

model UpdateInstanceImageResponseBody = {
  requestId?: string(name='RequestId', example='1A923337-44D9-5CAD-9A53-95084BD4****'),
  taskId?: string(name='TaskId', example='t-1ljew7on6ay0j****'),
}

model UpdateInstanceImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceImageResponseBody(name='body'),
}

/**
 * @summary 更新实例镜像
 *
 * @param request UpdateInstanceImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceImageResponse
 */
async function updateInstanceImageWithOptions(request: UpdateInstanceImageRequest, runtime: Util.RuntimeOptions): UpdateInstanceImageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.instanceIdList)) {
    query['InstanceIdList'] = request.instanceIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceImage',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新实例镜像
 *
 * @param request UpdateInstanceImageRequest
 * @return UpdateInstanceImageResponse
 */
async function updateInstanceImage(request: UpdateInstanceImageRequest): UpdateInstanceImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceImageWithOptions(request, runtime);
}

model UpgradeAndroidInstanceGroupRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable the auto-payment feature.

Valid values:

*   true: enables the auto-payment feature. Make sure that your Alibaba Cloud account has sufficient balance.
*   false: disables the auto-payment feature. You need to manually complete the payment process.', example='true'),
  increaseNumberOfInstance?: int32(name='IncreaseNumberOfInstance', description='The number of instances that you want to increase.', example='10'),
  instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='ag-asguicdjh****'),
}

model UpgradeAndroidInstanceGroupResponseBody = {
  instanceIds?: string(name='InstanceIds', description='The instance ID.', example='[\\\\"acp-3vzqq4y3f31f3z3df\\\\"]'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='223684716098****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='310A783E-CC46-5452-A8A3-71AE5DB59****'),
}

model UpgradeAndroidInstanceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeAndroidInstanceGroupResponseBody(name='body'),
}

/**
 * @summary Upgrades an instance group. Currently, this operation allows you to only increase the number of instances in an instance group.
 *
 * @description Currently, this operation allows you to only increase the size of an instance group.
 *
 * @param request UpgradeAndroidInstanceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeAndroidInstanceGroupResponse
 */
async function upgradeAndroidInstanceGroupWithOptions(request: UpgradeAndroidInstanceGroupRequest, runtime: Util.RuntimeOptions): UpgradeAndroidInstanceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.increaseNumberOfInstance)) {
    query['IncreaseNumberOfInstance'] = request.increaseNumberOfInstance;
  }
  if (!Util.isUnset(request.instanceGroupId)) {
    query['InstanceGroupId'] = request.instanceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeAndroidInstanceGroup',
    version = '2023-09-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Upgrades an instance group. Currently, this operation allows you to only increase the number of instances in an instance group.
 *
 * @description Currently, this operation allows you to only increase the size of an instance group.
 *
 * @param request UpgradeAndroidInstanceGroupRequest
 * @return UpgradeAndroidInstanceGroupResponse
 */
async function upgradeAndroidInstanceGroup(request: UpgradeAndroidInstanceGroupRequest): UpgradeAndroidInstanceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeAndroidInstanceGroupWithOptions(request, runtime);
}

